forked from OpenFn/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
73 lines (69 loc) · 1.91 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
68
69
70
71
72
73
x-lightning: &default-app
build:
dockerfile: Dockerfile-dev
context: '.'
target: '${MIX_ENV:-dev}'
args:
- 'MIX_ENV=${MIX_ENV:-dev}'
- 'NODE_ENV=${NODE_ENV:-development}'
depends_on:
- 'postgres'
restart: '${DOCKER_RESTART_POLICY:-unless-stopped}'
stop_grace_period: '3s'
tty: ${TTY:-false}
volumes:
- '${LIGHTNING_VOLUME:-./priv/static:/app/priv/static}'
services:
postgres:
deploy:
resources:
limits:
cpus: '${DOCKER_POSTGRES_CPUS:-0}'
memory: '${DOCKER_POSTGRES_MEMORY:-0}'
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-lightning_dev}
image: 'postgres:14.2-alpine'
restart: '${DOCKER_RESTART_POLICY:-unless-stopped}'
stop_grace_period: '3s'
volumes:
- 'postgres:/var/lib/postgresql/data'
web:
<<: *default-app
deploy:
resources:
limits:
cpus: '${DOCKER_WEB_CPUS:-0}'
memory: '${DOCKER_WEB_MEMORY:-0}'
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/lightning_dev
depends_on:
- postgres
healthcheck:
test: '${DOCKER_WEB_HEALTHCHECK_TEST:-curl localhost:4000/health_check}'
interval: '10s'
timeout: '3s'
start_period: '5s'
retries: 3
ports:
- '${LIGHTNING_EXTERNAL_PORT:-127.0.0.1:${PORT-4000}}:${URL_PORT-4000}'
worker:
image: 'openfn/ws-worker:latest'
deploy:
resources:
limits:
cpus: '${DOCKER_WORKER_CPUS:-0}'
memory: '${DOCKER_WEB_MEMORY:-0}'
depends_on:
web:
condition: service_healthy
restart: true
command:
['pnpm', 'start:prod', '-l', 'ws://web:${URL_PORT-4000}/worker']
restart: '${DOCKER_RESTART_POLICY:-unless-stopped}'
stop_grace_period: '3s'
expose:
- '2222'
volumes:
postgres: {}