Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue of ngnix with docker-compose #5

Open
Yashpk789987 opened this issue Mar 19, 2020 · 5 comments
Open

Issue of ngnix with docker-compose #5

Yashpk789987 opened this issue Mar 19, 2020 · 5 comments

Comments

@Yashpk789987
Copy link

I am not able to setup my backend with ngnix.

I am using the same commands in docker-comppose.yml and mysite.template as shown in video

docker-compose.yml

version: '3'
services:
redis:
image: redis
networks:
- webnet
db:
image: postgres
volumes:
- ./pgdata:/var/lib/postgresql/data
networks:
- webnet
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: slack
ports:
- '3030:5432'
web:
image: slack-clone-server
networks:
- webnet
environment:
DB_HOST: db
REDIS_HOST: redis
depends_on:
- db
- redis
command: ['node', 'app.js']
nginx:
image: nginx
volumes:
- ./mysite.template:/etc/nginx/conf.d/mysite.template
ports:
- '8081:80'
networks:
- webnet
depends_on:
- web
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
networks:
webnet:

AND mysite.template

server {
location / {
proxy_pass http://web:8081;
}
}

I am getting ERROR : cat: /etc/nginx/conf.d/mysite.template: Is a directory
server_nginx_1 exited with code 1

Please help me anyone

@benawad
Copy link
Owner

benawad commented Mar 20, 2020

Make sure mysite.template in that path

@Yashpk789987
Copy link
Author

Yes mysite.template is at right path.

You can see screenshot below.
ngnix

@Yashpk789987
Copy link
Author

Yes mysite.template is at right path.

You can see screenshot below.
ngnix

I am using windows10

@benawad
Copy link
Owner

benawad commented Mar 21, 2020

I'm not sure then

@Yashpk789987
Copy link
Author

What should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants