-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
67 lines (67 loc) · 1.69 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
58
59
60
61
62
63
64
65
66
67
version: "3.7"
volumes:
# Create volumes for docker to store stuff in that doesn't clash with local!
node_modules:
static:
python_cache:
services:
api:
build:
context: api
dockerfile: Dockerfile
env_file:
- ./api/app/.env.docker
environment:
- PYTHONPYCACHEPREFIX=python_cache
ports:
- "8080:8080"
volumes:
- ./api:/app:delegated
- static:/app/static # point to docker volume for static files
- python_cache:/app/python_cache
networks:
- wps_network
command: bash -c "PYTHONPATH=. poetry run alembic upgrade head && poetry run uvicorn app.main:app --host 0.0.0.0 --reload --port 8080"
redis:
image: redis
ports:
- "6379:6379"
networks:
- wps_network
nats:
image: nats
# we need to run nats with jetstream
command: -js
ports:
- 4222:4222
networks:
- wps_network
# Application's local database container & service
db:
image: postgis/postgis
hostname: db
ports:
- 5432:5432
environment:
- POSTGRES_USER=wps
- POSTGRES_PASSWORD=wps
- POSTGRES_DB=wps
- POSTGRES_HOST_AUTH_METHOD="trust"
networks:
- wps_network
web:
build:
context: web
dockerfile: Dockerfile
env_file:
- web/.env
ports:
- "3000:3000"
volumes:
- ./web:/app:delegated # Volume optimizations https://engageinteractive.co.uk/blog/making-docker-faster-on-mac
- node_modules:/app/node_modules/ # point to docker volume for node_modules
- static:/app/build # point to docker volume for static output
command: bash -c "yarn run build & yarn run start"
networks:
wps_network:
driver: bridge