Newer
Older

Lukáš Kratochvíl
committed
server:
container_name: server
image: server:1.0.0
build:
context: ./backend
dockerfile: Dockerfile
command: npm run start:debug
env_file: .env
ports:
- 127.0.0.1:${SERVER_PORT}:3000
volumes:
# changes in host's ./backend directory will be propagated to the container
- ./backend:/usr/src/app
# this prevents our host files from overriding container's node_modules
- exclude-server:/usr/src/app/node_modules/

Lukáš Kratochvíl
committed
networks:

Lukáš Kratochvíl
committed
restart: always

Lukáš Kratochvíl
committed
postgres:
container_name: postgres
image: postgres:14.3-alpine
env_file: .env
volumes:
- ./backend/database-storage:/var/lib/postgresql/data
networks:

Lukáš Kratochvíl
committed
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
restart: always
adminer:
container_name: adminer
image: adminer:4.8.1
env_file: .env
ports:
- 127.0.0.1:${ADMINER_PORT}:${ADMINER_PORT}

Lukáš Kratochvíl
committed
networks:
- backend-network

Lukáš Kratochvíl
committed
environment:
ADMINER_DESIGN: nette
restart: always
depends_on:

Lukáš Kratochvíl
committed
nginx:
container_name: nginx
image: nginx:1.21.6-alpine
ports:
- 127.0.0.1:${NGINX_PORT}:${NGINX_PORT}
volumes:
- ./nginx/templates:/etc/nginx/templates
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
networks:
- backend-network
environment:
- NGINX_PORT=${NGINX_PORT}
- SERVER_PORT=${SERVER_PORT}
restart: always
depends_on:
- server
- postgres
client:
container_name: client
image: client:1.0.0
build:
context: ./frontend
dockerfile: Dockerfile
env_file: .env
ports:
- 127.0.0.1:${CLIENT_PORT}:3000
volumes:
# changes in host's ./frontend directory will be propagated to the container
- ./frontend:/usr/src/app
# this prevents our host files from overriding container's node_modules
- exclude-client:/usr/src/app/node_modules/
restart: always

Lukáš Kratochvíl
committed
volumes:
database-storage:
exclude-server:
exclude-client: