Skip to content

Instantly share code, notes, and snippets.

@vcanales
Created January 28, 2020 16:05
Show Gist options
  • Save vcanales/7e3d46a624eb88b2035f7ed27ad767e5 to your computer and use it in GitHub Desktop.
Save vcanales/7e3d46a624eb88b2035f7ed27ad767e5 to your computer and use it in GitHub Desktop.
version: '3'
services:
db:
image: postgres
ports:
- '5432:5432'
environment:
POSTGRES_USER: project_name
POSTGRES_PASSWORD: project_name
POSTGRES_DB: project_name
volumes:
- ./docker/postgres:/var/lib/postgres
redis:
image: redis:5-alpine
ports:
- '6379:6379'
volumes:
- ./docker/redis:/data
api:
image: 'node:13'
user: 'node'
working_dir: /home/node/app
volumes:
- ./:/home/node/app
environment:
NODE_ENV: development
DBHOST: db
DBNAME: project_name
DBPASS: project_name
DBUSER: project_name
PORT: 3000
REDIS_CONNECTION_STRING: redis://redis
REDIS_CACHE_TIMEOUT: 300
expose:
- '3000'
ports:
- '3000:3000'
command: 'npm run start:dev'
depends_on:
- db
- redis
links:
- db
- redis
@vcanales
Copy link
Author

The start:dev command:

"scripts": {
  "start:dev": "npx nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' --exec 'npx ts-node' src/index.ts"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment