Created
March 18, 2021 23:21
-
-
Save redeemefy/fb5bdb50ba40caad83693d8cd1d7d036 to your computer and use it in GitHub Desktop.
A docker-compose.yml for developing with NestJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
main: | |
container_name: main | |
build: | |
context: . | |
target: development | |
volumes: | |
- .:/usr/src/app | |
- /usr/src/app/node_modules | |
ports: | |
- ${SERVER_PORT}:${SERVER_PORT} | |
- 9229:9229 | |
command: npm run start:dev | |
env_file: | |
- .env | |
networks: | |
- webnet | |
depends_on: | |
- redis | |
- postgres | |
redis: | |
container_name: redis | |
image: redis:5 | |
networks: | |
- webnet | |
postgres: | |
container_name: postgres | |
image: postgres:12 | |
networks: | |
- webnet | |
environment: | |
POSTGRES_PASSWORD: ${DB_PASSWORD} | |
POSTGRES_USER: ${DB_USERNAME} | |
POSTGRES_DB: ${DB_DATABASE_NAME} | |
PG_DATA: /var/lib/postgresql/data | |
ports: | |
- 5432:5432 | |
volumes: | |
- pgdata:/var/lib/postgresql/data | |
networks: | |
webnet: | |
volumes: | |
pgdata: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment