UNS/docker-compose.yaml

99 lines
2.0 KiB
YAML

version: '3.9'
networks:
dns_net:
driver: bridge
services:
mongo:
image: mongo
container_name: dns-mongo-db
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
ports:
- '27017:27017'
networks:
- dns_net
volumes:
- mongodata:/data/db
restart: always
postgres:
image: postgres:13
container_name: dns-postgres-db
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "${POSTGRES_PORT}:5432"
networks:
- dns_net
restart: always
nginx:
image: nginx:alpine
container_name: dns-nginx
ports:
- "${NGINX_PORT}:80"
volumes:
# - ./frontend/geotouchka-web-application/build:/usr/share/nginx/html
- ./nginx.conf:/etc/nginx/nginx.conf
networks:
- dns_net
depends_on:
- front
restart: always
server:
container_name: dns-server
build:
context: ./src/server
dockerfile: Dockerfile
env_file: ".env"
ports:
- "8080:8080"
depends_on:
- postgres
- mongo
networks:
- dns_net
restart: always
socket:
container_name: dns-socket
build:
context: ./src/socket
dockerfile: Dockerfile
env_file: ".env"
ports:
- "${SOCKET_BASE_ADDRESS}:${SOCKET_BASE_ADDRESS}"
networks:
- dns_net
restart: always
front:
container_name: dns-ui
build:
context: ./src/frontend
dockerfile: Dockerfile
env_file: ".env"
volumes:
- ./src/frontend:/app
working_dir: /app
command: ["npm", "start"]
ports:
- "3000:3000"
networks:
- dns_net
restart: always
volumes:
postgres_data:
mongodata:
driver: local