benawad / benawad/slack-clone-server

Issue of ngnix with docker-compose

Open
#5 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
443
Forks
145
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with docker-compose.yml and mysite.template, then inspect the nginx service volume and command alongside the container logs showing that mysite.template is a directory. Run the compose setup and verify that nginx remains running and proxies requests to the web service through the configured port.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, nginx, node.js, postgresql, redis
Domain
backend, devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.