forked from serebrov/flask-vue-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (50 loc) · 1.51 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
version: '3'
services:
backend:
restart: always
image: python:3.7
# User setting to have files with correct permissions on the host.
# Requires export $UID=$UID and export $GID=$GID somewhere (~/.bashrc or ~/.zshrc)
# This is because UID and GID are shell variables, not env variables,
# so it doesn't work without export.
# See also: https://github.com/docker/compose/issues/2380
user: "${UID}:${GID}"
# Entrypoint activates virtual environment and refreshes dependencies
working_dir: /src
entrypoint: ./docker-entrypoint.sh
command: flask run
# command: /bin/bash -c "sleep infinity & wait"
volumes:
- ./backend:/src:cached
ports:
- "5000:5000"
environment:
FLASK_APP: /src/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: always
build:
context: frontend
dockerfile: Dockerfile
args:
- UID=$UID
- GID=$GID
user: "node"
command: /bin/bash -c "yarn install && yarn serve"
volumes:
- ./frontend:/src:cached
ports:
- "8080:8080"
postgresql:
image: postgres:14.0-bullseye
user: "${UID}:${GID}"
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpw
ports:
- "5432:5432"
volumes:
- ./data/postgresql:/var/lib/postgresql/data