-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
49 lines (45 loc) · 1.43 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
version: '3.8'
# Add this file to extend the docker-compose setup, e.g.:
# docker-compose build --no-cache
# docker-compose up -d --build --force-recreate
services:
app:
build:
context: .
# development or runner
target: development
tty: true
stdin_open: true
volumes:
- .:/app
- node_modules:/app/node_modules
depends_on:
- postgres
environment:
# change from development to production if needed
NODE_ENV: development
DATABASE_PROVIDER: ${DATABASE_PROVIDER:-postgres}
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
restart: always
ports:
- 3000:3000
postgres:
image: postgres:15-alpine
# Pass config parameters to the mysql server.
# Find more information below when you need to generate the ssl-relevant file your self
environment:
POSTGRES_DB: ${POSTGRES_DB:?}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_USER: ${POSTGRES_USER:?}
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
# Exposing the port is not needed unless you want to access this database instance from the host.
# Be careful when other postgres docker container are running on the same port
# ports:
# - "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data/pgdata
volumes:
postgres_data:
node_modules: