Files
42_INT_14_transcendence/srcs/docker-compose.yml

118 lines
2.9 KiB
YAML

services:
dev:
container_name: nestjs_api_dev
image: nestjs_api_dev
build:
context: ./requirements/nestjs
target: development
dockerfile: Dockerfile
command: npm run start:dev
ports:
- 3000:3000
networks:
- transcendance_network
volumes:
- ./requirements/nestjs/api_back:/usr/src/app
- /usr/src/app/node_modules
env_file:
- .env
environment:
NODE_ENV: "${NODE_ENV}"
restart: unless-stopped
depends_on:
- postgresql
- redis
prod:
container_name: nestjs_api_prod
image: nestjs_api_prod
build:
context: ./requirements/nestjs
target: production
dockerfile: Dockerfile
command: npm run start:prod
ports:
- 3000:3000
networks:
- transcendance_network
volumes:
- data_nest_back:/usr/src/app
- /usr/src/app/node_modules
restart: unless-stopped
env_file:
- .env
environment:
NODE_ENV: "${NODE_ENV}"
depends_on:
- postgresql
- redis
postgresql:
container_name: nestjs_postgresql
image: postgres
ports:
- 5432:5432
networks:
- transcendance_network
volumes:
- data_nest_postgresql:/var/lib/postgresql/data
restart: unless-stopped
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_HOST: "${POSTGRES_HOST}"
POSTGRES_PORT: "${POSTGRES_PORT}"
redis:
container_name: nestjs_redis
image: redis:alpine
expose:
- "6379"
networks:
- transcendance_network
restart: unless-stopped
environment:
REDIS_HOST: "${REDIS_HOST}"
REDIS_PORT: "${REDIS_PORT}"
networks:
transcendance_network:
driver: bridge
volumes:
data_nest_back:
data_nest_postgresql:
data_nest_redis:
# debug:
# container_name: nestjs_api_debug
# image: nestjs_api_debug
# build:
# context: ./requirements/nestjs
# target: development
# dockerfile: Dockerfile
# command: run start:dev --debug 0.0.0.0:9229
# ports:
# - 3000:3000
# - 9229:9229
# networks:
# - transcendance_network
# volumes:
# - ./requirements/nestjs/api_back:/usr/src/app
# - /usr/src/app/node_modules
# env_file:
# - .env
# environment:
# NODE_ENV: "${NODE_ENV}"
# DEBUG: "*" # enable all debug logs
# restart: unless-stopped
# depends_on:
# - postgresql