Nginx timeout in docker-swarm - docker-swarm

The docker-compose.yml posted below to bring up a simple nginx-Container works perfectly fine with
docker-compose up
But if I bring it up in docker-swarm with
docker stack deploy -c=docker-compose.yml nginx
I just get a timeout trying to reach the nginx...
Any ideas how to debug this or what could be the cause?
version: "3.5"
services:
nginx:
image: nginx
ports:
- 80:80

Related

How to connect to external FTP from NiFi running in docker container?

I have:
NiFi running in docker container. I'm running NiFi via Docker Compose with the following config:
version: '3'
services:
nifi:
image: apache/nifi:latest
container_name: nifi
ports:
- "8443:8443"
volumes:
- ./database_repository:/opt/nifi/nifi-current/database_repository
- ./flowfile_repository:/opt/nifi/nifi-current/flowfile_repository
- ./content_repository:/opt/nifi/nifi-current/content_repository
- ./provenance_repository:/opt/nifi/nifi-current/provenance_repository
- ./state:/opt/nifi/nifi-current/state
- ./logs:/opt/nifi/nifi-current/logs
- ./conf:/opt/nifi/nifi-current/conf
restart: always
FTP server located on localhost (outside the container)
In the NiFi route i'm using a GetFTP processor which tries unsuccessfully to connect to localhost:21
I understand that the problem is that localhost is not available, because container is isolated. What and how to configure in the docker-compose.yml configuration to solve the problem?

Vuejs nginx dockerised app not working with docker-compose

I have a production stage dockerised vuejs front end app served with nginx server.
When I run the single container using the command:
docker run -p 80:80 my-dockerhub-username/my-vuejs-app
then it runc fine and I can reach it on port 80.
...however, for some reason when I use docker-compose to spin up my app using the following docker-compose.yml:
version: '3'
services:
api:
image: my-dockerhub-username/my-vuejs-app
ports:
- 80:80
web:
image: my-dockerhub-username/my-rest-api
ports:
- 9001:9001
I cannot reach my app on port 80.
Has anybody else experienced this issue?
I would appreciate any sugestions anybody can offer. Thanks in advance.

rancher network docker-compose

compose this .yml
version: '2'
services:
wordpress:
image: wordpress:latest
expose:
- 80
restart: always
networks:
- nginx-proxy
environment:
- VIRTUAL_HOST=blog.gerling.one
container_name: wordpress
networks:
nginx-proxy:
external: true
when i run the docker-compose.yml with
docker-compose up
the container starts with Network: nginx-proxy -> all Works
but when i start with
rancher-compose <API SETTINGS> up
the container starts with Network: Managed and nothing works
Yeah its right that nothing works but how i can start with nginx-proxy in rancheros?
Thanks for the help.
Networking in Rancher is different from Docker. So the docker compose file doesn't work as-is. To achieve what you are trying to accomplish there are a few options:
Checkout the Wordpress Catalog item in Rancher Catalog
Manually start Wordpress service and create a Load Balancer in Rancher UI and use the Host information there.

Aspnet core application is not running after docker host or container restart

I'm running containers with restart policy as always through docker-compose, it has two images RabbitMq & AspNetCore,it all works fine for the first time.
when I restart the host or docker containers then RabbitMq is running fine and accessible through localhost:8080 even after restarting, but aspnet core project container is running but I can't access through internal and external ( localhost:5001/api/home/get) ports.
Docker compose
version: '3.4'
services:
aspnetcoreenvironmentvariables.api:
image: aspnetcoreenvironmentvariables
build:
context: .
dockerfile: AspNetCoreEnvironmentVariables.API/Dockerfile
restart: always
depends_on:
- rabbitmq
rabbitmq:
image: rabbitmq:3-management
restart: always
Docker compose override
version: '3.4'
services:
aspnetcoreenvironmentvariables.api:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__DefaultConnection="connection"
ports:
- "5001:80"
rabbitmq:
ports:
- "8080:15672"
Below is error from docker

Turning down a web server from a running container via bash

I have the following docker-compose.yml to start a webserver with PHP.
version: "2.0"
services:
nginx:
image: nginx
ports:
- "8000:80"
volumes:
- ./web:/web
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
php:
image: php:${PHP_VERSION}-fpm
volumes:
- ./web:/web
After running docker-compose up, I can access my website perfectly at http://localhost:8000. But if I then access the nginx container, with:
$ docker-compose run nginx bash
and within the container I run:
$ service nginx stop
I still can see the website http://localhost:8000 being displayed in the browser.
How can it be that after stopping the server in the container, the website is still being delivered?
The docker-compose run command starts a new container, you're stopping nginx in that new container, what you want is docker attach nginx
The documentation is located here.

Resources