-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
57 lines (54 loc) · 1.55 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
53
54
55
56
57
services:
backend:
restart: unless-stopped
build:
context: backend
dockerfile: Dockerfile
args:
# Services that use host files need to run with the same UID/GID as the host
# user for these files to be accessible in both host and docker.
# Here, `UID` and `GID` are forwarded as build args to create the user.
# Requires `export UID=$UID` and `export GID=$GID` somewhere (~/.bashrc or ~/.zshrc).
# See also: https://github.com/docker/compose/issues/2380
UID: $UID
GID: $GID
entrypoint: ./docker-entrypoint.sh
command: flask run
depends_on:
- postgresql
volumes:
- ./backend:/backend
ports:
- "5000:5000"
environment:
FLASK_APP: /backend/app/app.py
FLASK_RUN_HOST: 0.0.0.0
FLASK_CONFIG: local
SQLALCHEMY_DATABASE_URI: 'postgresql://testuser:testpw@postgresql:5432/forum'
SQLALCHEMY_TEST_DATABASE_URI: 'postgresql://testuser:testpw@postgresql:5432/forumtest'
frontend:
restart: unless-stopped
build:
context: frontend
dockerfile: Dockerfile
args:
- UID=$UID
- GID=$GID
user: "node"
command: /bin/bash -c "yarn install && yarn serve"
depends_on:
- backend
volumes:
- ./frontend:/frontend
ports:
- "8080:8080"
postgresql:
image: postgres:13
user: "${UID}:${GID}"
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpw
ports:
- "5432:5432"
volumes:
- ./data/postgresql:/var/lib/postgresql/data