This repository was archived by the owner on Mar 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (53 loc) · 1.55 KB
/
docker-compose.yml
File metadata and controls
56 lines (53 loc) · 1.55 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
################################################################################
# Day1 Docker Compose (Go backend)
#
# Usage:
# docker compose --profile dev up -d
# docker compose --profile prod up -d
# docker compose --profile dev --profile matrixone up -d
#
# DB behavior:
# - If DAY1_DATABASE_URL is set in system env or .env, it is used as-is.
# - Otherwise, service-specific fallback URLs are used (port 6001).
# - Local MatrixOne is optional via profile "matrixone".
################################################################################
services:
matrixone:
image: matrixorigin/matrixone:latest
container_name: day1-matrixone
environment:
MYSQL_ROOT_PASSWORD: ${MATRIXONE_ROOT_PASSWORD:-111}
ports:
- "6001:6001"
restart: unless-stopped
profiles: ["matrixone"]
api:
build:
context: .
target: api
ports:
- "9821:9821"
env_file:
- .env
environment:
DAY1_DATABASE_URL: ${DAY1_DATABASE_URL:-mysql+aiomysql://root:111@host.docker.internal:6001/day1}
DAY1_PORT: "9821"
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
profiles: ["prod"]
api-dev:
build:
context: .
target: api-dev
network_mode: host
env_file:
- .env
environment:
DAY1_DATABASE_URL: ${DAY1_DATABASE_URL:-mysql+aiomysql://root:111@127.0.0.1:6001/day1}
DAY1_PORT: "${DAY1_PORT:-9821}"
volumes:
- ./:/app
command: ["go", "run", "./cmd/day1-api"]
restart: unless-stopped
profiles: ["dev"]