102 lines
2.6 KiB
YAML
102 lines
2.6 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
|
|
|
|
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
|
|
|
|
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}"
|
|
|
|
networks:
|
|
transcendance_network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
data_nest_back:
|
|
data_nest_postgresql:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|