-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.docker-compose.yml
103 lines (96 loc) · 3.05 KB
/
dev.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
services:
dev_db:
image: postgis/postgis:16-3.4-alpine
container_name: jamsessions_dev_db
volumes: # create schema and roles on startup
- ./backend/internal/db/schema.sql:/docker-entrypoint-initdb.d/001_schema.sql
- ./backend/internal/db/scripts/add-roles.sh:/docker-entrypoint-initdb.d/002_roles.sh
- ./backend/internal/db/scripts/add-test-data.sql:/docker-entrypoint-initdb.d/003_data.sql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
READ_ONLY_PASSWORD: $READ_ONLY_PASSWORD
READ_WRITE_PASSWORD: $READ_WRITE_PASSWORD
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U read_write -d ${POSTGRES_DB}'"]
interval: 10s
timeout: 3s
retries: 3
dev_api:
build:
context: backend
dockerfile: Dockerfile.dev
args:
GO_VERSION: 1.23
image: jamsessions_dev_api
user: $DEV_UID:$DEV_GID
container_name: jamsessions_dev_api
volumes:
- "./backend:/app"
environment:
DB_URL: "host=dev_db port=5432 user=read_write password=${READ_WRITE_PASSWORD} dbname=${POSTGRES_DB} sslmode=disable"
MIGRATIONS_DIRECTORY: /app/migrations
MIGRATIONS_SUGGESTIONS: /app/migrations/suggestions
SERVER_ADDRESS: 0.0.0.0:80
depends_on:
- dev_db
healthcheck:
test: ["CMD", "/app/bin/healthcheck", "http://localhost:80"]
interval: 1s
timeout: 1s
retries: 3
dev_frontend:
build:
context: frontend
dockerfile: Dockerfile.dev
image: jamsessions_dev_frontend
container_name: jamsessions_dev_frontend
volumes:
- "./frontend/src:/workspace/src"
- "jamsessions_node_modules_dev:/workspace/node_modules"
command: ["--", "--host", "0.0.0.0", "--port", "5173"]
restart: unless-stopped
depends_on:
- dev_api
proxy:
image: caddy:2-alpine
hostname: proxy # prometheus config in deploy/ expects host to be called proxy
container_name: jamsessions_dev_proxy
volumes:
- ./deploy/Caddyfile:/etc/caddy/Caddyfile
- ./deploy/caddy-data-dev:/data
environment:
HOST: :80
FRONTEND_URL: dev_frontend:5173
API_URL: dev_api:80
ports:
- "127.0.0.1:$DEV_PORT:80"
- "127.0.0.1:2019:2019"
depends_on:
- dev_frontend
- dev_api
restart: unless-stopped
dev_prometheus:
image: prom/prometheus:latest
volumes:
- ./deploy/prometheus.yml:/etc/prometheus/prometheus.yml
- jamsessions_prometheus_dev:/prometheus
ports:
- 127.0.0.1:9090:9090 # expose ui to localhost
depends_on:
- proxy
# dev_tile_server:
# image: caddy:2.8.4-alpine
# container_name: jamsessions_dev_tiles
# environment:
# FRONTEND_URL: http://localhost:$DEV_FRONTEND_PORT
# volumes:
# - ./tiles/Caddyfile:/etc/caddy/Caddyfile
# - ./tiles/london.pmtiles:/files/london.pmtiles
# restart: unless-stopped
# ports:
# - "127.0.0.1:${DEV_TILES_PORT}:80"
volumes:
jamsessions_node_modules_dev:
jamsessions_prometheus_dev: