-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (50 loc) · 1.16 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
50
51
52
version: "3"
services:
# https://hub.docker.com/_/postgres/
database:
image: postgres:14.2-alpine
container_name: database
restart: always
ports:
- "5432:5432"
volumes:
- type: volume
source: pgdata
target: /var/lib/postgresql/data
- type: bind
source: ./initdb.sql
target: /docker-entrypoint-initdb.d/00-init.sql
read_only: true
environment:
POSTGRES_USER: acronymapi
POSTGRES_PASSWORD: password
POSTGRES_DB: defaultdb
# https://hub.docker.com/_/node
backend:
container_name: backend
ports:
- "8080:8080"
depends_on:
- database
build:
context: .
dockerfile: Dockerfile
volumes:
- type: bind
source: ./src
target: /app/src
read_only: true
environment:
PORT: 8080
NODE_ENV: development
# https://node-postgres.com/features/connecting
PGUSER: acronymapi
PGPASSWORD: password
PGDATABASE: defaultdb
PGHOST: database
PGPORT: 5432
# Credentials for POST and DELETE endpoints
API_USER: username
API_PASSWORD: password
volumes:
pgdata: {}