Skip to content

Commit 44eb93a

Browse files
committed
update docker build
1 parent fc61e02 commit 44eb93a

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/build.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Docker Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- "feature/**"
9+
- "hotfix/**"
10+
tags:
11+
- "v*.*.*"
12+
pull_request:
13+
branches:
14+
- main
15+
- develop
16+
17+
jobs:
18+
docker:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: pnstack/actions/docker-publish@main
22+
with:
23+
platforms: linux/amd64,linux/arm64
24+
dockerfile: Dockerfile
25+
context: .
26+
push_enabled: true
27+
registry: ghcr.io

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Base image with uv and Python 3.11
2+
FROM ghcr.io/astral-sh/uv:python3.11-bookworm as base
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Enable UV optimizations
8+
ENV UV_COMPILE_BYTECODE=1
9+
ENV UV_LINK_MODE=copy
10+
11+
# Install dependencies into .venv using uv
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
14+
--mount=type=bind,source=uv.lock,target=uv.lock \
15+
uv sync --frozen --no-install-project --no-dev
16+
17+
# Add the venv to the PATH
18+
ENV PATH="/app/.venv/bin:$PATH"
19+
20+
# Make `python` the entrypoint so you can run scripts easily
21+
ENTRYPOINT ["python"]

0 commit comments

Comments
 (0)