Skip to content

Instantly share code, notes, and snippets.

@redeemefy
Created March 18, 2021 23:21
Show Gist options
  • Save redeemefy/fb5bdb50ba40caad83693d8cd1d7d036 to your computer and use it in GitHub Desktop.
Save redeemefy/fb5bdb50ba40caad83693d8cd1d7d036 to your computer and use it in GitHub Desktop.
A docker-compose.yml for developing with NestJS
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