woj-server/docker-compose.yml

97 lines
2.2 KiB
YAML
Raw Permalink Normal View History

2023-07-15 18:14:50 +08:00
services:
server:
2024-03-14 17:27:34 +08:00
image: quay.io/ldcraft/woj-server:1.3.1-dev
2023-07-15 18:14:50 +08:00
restart: unless-stopped
healthcheck:
2023-08-11 18:54:00 +08:00
test: [ "CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8000/health" ]
interval: 5s
2023-12-19 01:09:02 +08:00
command: server
2023-07-15 18:14:50 +08:00
environment:
- REDIS_ADDRESS=cache
2023-07-15 18:14:50 +08:00
- DATABASE_HOST=db
- DATABASE_USER=dev
- DATABASE_PASSWORD=password
- DATABASE_NAME=dev
2023-08-11 18:54:00 +08:00
- STORAGE_ENDPOINT=storage:9000
2023-07-15 18:14:50 +08:00
- STORAGE_ACCESS_KEY=access_key
- STORAGE_SECRET_KEY=secret_key
- STORAGE_BUCKET=woj
- DEVELOPMENT=true
volumes:
- /etc/localtime:/etc/localtime:ro
depends_on:
2024-03-13 22:17:00 +08:00
- storage
- cache
- db
2023-07-15 18:14:50 +08:00
ports:
- "8000:8000"
2023-08-11 18:54:00 +08:00
runner:
2024-03-14 17:27:34 +08:00
image: quay.io/ldcraft/woj-runner:1.3.1-dev
2023-08-11 18:54:00 +08:00
restart: unless-stopped
command: runner
2024-03-14 17:27:34 +08:00
# moby/moby#42040, enable privileged option to make cgroup2 mount as rw
2024-01-27 19:11:26 +08:00
privileged: true
2023-08-11 18:54:00 +08:00
cap_add:
- SYS_ADMIN
environment:
- REDIS_ADDRESS=cache
2023-08-11 18:54:00 +08:00
- STORAGE_ENDPOINT=storage:9000
- STORAGE_ACCESS_KEY=access_key
- STORAGE_SECRET_KEY=secret_key
- STORAGE_BUCKET=woj
- DEVELOPMENT=true
volumes:
- runner:/app/resource/runner/user
- /etc/localtime:/etc/localtime:ro
depends_on:
2024-03-13 22:17:00 +08:00
- storage
- cache
- db
2023-07-15 18:14:50 +08:00
storage:
2023-08-11 18:54:00 +08:00
image: quay.io/minio/minio:latest
2023-07-15 18:14:50 +08:00
restart: unless-stopped
entrypoint: sh
command: -c 'mkdir -p /data/woj && minio server /data'
environment:
2023-08-11 18:54:00 +08:00
MINIO_ROOT_USER: "access_key"
MINIO_ROOT_PASSWORD: "secret_key"
2024-03-13 20:03:12 +08:00
ports:
- "9000:9000"
2023-07-15 18:14:50 +08:00
volumes:
- storage:/data
cache:
2023-08-11 18:54:00 +08:00
image: docker.io/library/redis:alpine
2023-07-15 18:14:50 +08:00
restart: unless-stopped
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
2024-03-13 20:03:12 +08:00
ports:
- "6379:6379"
2023-07-15 18:14:50 +08:00
volumes:
- cache:/data
db:
2023-12-23 16:46:34 +08:00
image: docker.io/library/postgres:16-alpine
2023-07-15 18:14:50 +08:00
restart: unless-stopped
healthcheck:
test: [ "CMD", "pg_isready", "-U", "dev" ]
interval: 5s
environment:
- POSTGRES_USER=dev
- POSTGRES_PASSWORD=password
- POSTGRES_DB=dev
2024-03-13 20:03:12 +08:00
ports:
- "5432:5432"
2023-07-15 18:14:50 +08:00
volumes:
- db:/var/lib/postgresql/data
volumes:
runner:
container:
2023-07-15 18:14:50 +08:00
storage:
cache:
2023-08-11 18:54:00 +08:00
db: