zkt24/z1/docker-compose.yml

58 lines
1.0 KiB
YAML
Raw Normal View History

2024-04-10 09:23:23 +00:00
services:
nginx:
build: .
container_name: nginx
restart: "always"
privileged: true
links:
- "go-api:api"
- "frontend:frontend"
ports:
- 80:80
networks:
- internalnet
go-api:
build: ./backend
restart: "always"
container_name: api
environment:
- DB_USER=${POSTGRES_USER}
- DB_PASSWORD=${POSTGRES_PASSWORD}
- DB_NAME=${POSTGRES_DB}
- DB_HOST=db
- DB_PORT=5432
ports:
- 3000:3000
depends_on:
- db
networks:
- internalnet
frontend:
build: ./frontend
restart: "always"
container_name: frontend
ports:
- 3001:3000
networks:
- internalnet
db:
image: postgres:latest
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- internalnet
networks:
internalnet:
driver: bridge
volumes:
postgres_data: