Skip to content

Instantly share code, notes, and snippets.

@yuya-maemichi-synspective
Last active May 22, 2025 03:47
Show Gist options
  • Save yuya-maemichi-synspective/8f796c46e0c34e58125c9365d8cad92b to your computer and use it in GitHub Desktop.
Save yuya-maemichi-synspective/8f796c46e0c34e58125c9365d8cad92b to your computer and use it in GitHub Desktop.
use Docker Compose with uv workspace
services:
package-name:
build:
dockerfile: ./packages/package-name/Dockerfile
secrets:
- source: github_token
target: GITHUB_TOKEN
target: builder
entrypoint: /opt/uv/uv run cli-name
environment:
GOOGLE_APPLICATION_CREDENTIALS: &gcloud_credentials /app/gcloud/application_default_credentials.json
env_file:
- .env
ports:
- "8000:8000"
volumes:
- type: bind
source: ${HOME}/.config/gcloud/application_default_credentials.json
target: *gcloud_credentials
- type: image
source: ghcr.io/astral-sh/uv
target: /opt/uv
develop:
watch:
- action: rebuild
path: ./packages/package-name/pyproject.toml
target: /home/python/app
- action: sync
path: .
target: /home/python/app
ignore:
- .git
- .venv
- __pycache__
- dist
- build
name: my_project
include:
- # package-name
path: ./packages/package-name/compose.yaml
project_directory: .
secrets:
github_token:
environment: GIHHUB_TOKEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment