forked from GoogleCloudPlatform/gcc-creative-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (67 loc) · 2.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (67 loc) · 2.65 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
# 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:
- "8080:8080"
restart: unless-stopped
env_file:
- ./backend/.env # Update as needed, for ex to './backend/.local.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
volumes:
backend_venv: