Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
97 lines (90 loc) · 2.81 KB
/
Copy pathcompose.yml
File metadata and controls
97 lines (90 loc) · 2.81 KB
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
name: ${COMPOSE_PROJECT_NAME:-sqlbuild}
services:
postgres:
image: docker.io/library/postgres:17.6-alpine3.22
environment:
POSTGRES_USER: sqlbuild
POSTGRES_DB: sqlbuild
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}
healthcheck:
test: [CMD-SHELL, "pg_isready -U sqlbuild -d sqlbuild"]
interval: 2s
timeout: 2s
retries: 30
volumes:
- control:/var/lib/postgresql/data
networks: [control]
server:
image: ${SQLBUILD_SERVER_IMAGE:-sqlbuild-server:local}
build:
context: .
dockerfile: deploy/Dockerfile
target: server
args:
PYTHON_VERSION: ${PYTHON_VERSION:-3.12}
SQLBUILD_SOURCE: ${SQLBUILD_SOURCE:-wheels}
SQLBUILD_VERSION: ${SQLBUILD_VERSION:-}
environment:
- SQLBUILD_CONTROL_DATABASE_URL=${SQLBUILD_CONTROL_DATABASE_URL:?Set SQLBUILD_CONTROL_DATABASE_URL}
- SQLBUILD_PLATFORM_WEBHOOK_URL
group_add: ["${DOCKER_GID:?Set DOCKER_GID to the Docker socket group}"]
volumes:
- ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock
configs:
- source: server
target: /etc/sqlbuild/server.toml
ports:
- "${SQLBUILD_BIND_ADDRESS:-127.0.0.1}:${SQLBUILD_PORT:-8000}:8000"
healthcheck:
test: [CMD, curl, --fail, --silent, --output, /dev/null, "http://localhost:8000/api/openapi.json"]
interval: 2s
timeout: 2s
retries: 30
depends_on:
postgres:
condition: service_healthy
networks: [control, workers]
location:
image: ${SQLBUILD_LOCATION_IMAGE:-sqlbuild-orders:local}
container_name: ${COMPOSE_PROJECT_NAME:-sqlbuild}-location
build:
context: .
dockerfile: deploy/Dockerfile
target: location
args:
PYTHON_VERSION: ${PYTHON_VERSION:-3.12}
SQLBUILD_SOURCE: ${SQLBUILD_SOURCE:-wheels}
SQLBUILD_VERSION: ${SQLBUILD_VERSION:-}
SQLBUILD_GIT_REVISION: ${SQLBUILD_GIT_REVISION:?Set SQLBUILD_GIT_REVISION}
command: [location, serve, --server, "http://server:8000", --location-id, "${SQLBUILD_LOCATION_ID:?Set SQLBUILD_LOCATION_ID}", --target, development]
environment:
SQLBUILD_LOCATION_TOKEN: ${SQLBUILD_LOCATION_TOKEN:-}
volumes:
- warehouse:/warehouse
cpus: 2
mem_limit: 1g
depends_on:
server:
condition: service_healthy
networks: [workers]
configs:
server:
content: |
[server]
host = "0.0.0.0"
port = 8000
[[launchers.docker]]
location = "orders"
target = "development"
server_url = "http://server:8000"
max_workers = 1
socket = "/var/run/docker.sock"
location_container = "${COMPOSE_PROJECT_NAME:-sqlbuild}-location"
executable = "/usr/local/bin/sqb"
volumes:
control:
warehouse:
networks:
control:
internal: true
workers: