-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (103 loc) · 3.47 KB
/
docker-compose.yml
File metadata and controls
114 lines (103 loc) · 3.47 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: creative-studio-backend
ports:
- "9000:8080"
restart: unless-stopped
depends_on:
- postgres
env_file:
- ./backend/.env
# Override the Dockerfile's CMD to enable --reload.
# Using 1 worker is better for a dev/reload environment.
# Use uvicorn's native --reload for development
command: >
sh -c "
uv sync --locked --no-dev &&
uvicorn main:app --host 0.0.0.0 --port 8080 --workers 1 --reload
"
volumes:
# Mount your local backend source code into the container
- ./backend:/app
# KEEP THIS: It preserves the virtual environment from the image build.
- backend_venv:/app/.venv
# Mount the gcloud ADC directory. Replace with the correct path for your OS if different. :ro - read-only for better security
- ~/.config/gcloud/:/root/.config/gcloud:ro # Linux/macOS example:
# - %APPDATA%/gcloud:/root/.config/gcloud:ro # Windows example:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
# Tell Docker Compose to run the 'builder' stage,
# not the final 'nginx' stage.
target: builder
container_name: creative-studio-frontend
ports:
- "4200:8080"
# To change the env variables in the frontend, change the environment.ts file
restart: unless-stopped
# Reset the entrypoint from the base 'node' image.
# This allows our 'command:' to run directly.
entrypoint: []
# Override the Dockerfile's CMD to run the dev server.
# This server watches for file changes.
command: ["npm", "run", "start", "--", "--host", "0.0.0.0", "--port", "8080", "--disable-host-check", "--proxy-config", "proxy.conf.json"]
volumes:
# Mount just your 'src' directory. 'ng serve' will
# see changes here and hot-reload.
- ./frontend/src:/app/src
# Mount the proxy config explicitly
- ./frontend/proxy.conf.json:/app/proxy.conf.json
# Define the named volume at the top level
postgres:
image: postgres:15-alpine
container_name: creative-studio-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=studio_user
- POSTGRES_PASSWORD=studio_pass
- POSTGRES_DB=creative_studio
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U studio_user -d creative_studio"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
adminer:
image: adminer
container_name: creative-studio-adminer
ports:
- "8081:8080"
depends_on:
- postgres
restart: unless-stopped
pre-commit:
build:
context: .
dockerfile: infra/pre-commit/Dockerfile.pre-commit
container_name: creative-studio-pre-commit
volumes:
- .:/app
working_dir: /app
volumes:
backend_venv:
postgres_data: