Skip to content

Commit 175986f

Browse files
committed
chore: chnage docker image from debian to alpine
1 parent 0d1132b commit 175986f

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

Dockerfile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
# Build stage
2-
FROM python:3.13-slim-bookworm AS builder
3-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
2+
FROM ghcr.io/astral-sh/uv:python3.13-alpine AS builder
43

54
WORKDIR /app
65

7-
# Install dependencies
8-
RUN --mount=type=cache,target=/root/.cache/uv \
9-
--mount=type=bind,source=uv.lock,target=uv.lock \
10-
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
11-
uv sync --locked --no-install-project --no-editable
12-
136
# Copy the project into the intermediate image
147
ADD . /app
158

169
# Sync the project
1710
RUN --mount=type=cache,target=/root/.cache/uv \
18-
uv sync --locked --no-editable
11+
uv sync --locked --no-editable --no-default-groups
1912

2013
# Final image stage
21-
FROM python:3.13-slim-bookworm
22-
23-
# Use Bash
24-
SHELL ["/bin/bash", "-c"]
14+
FROM python:3.13-alpine
2515

26-
RUN useradd --user-group --system --create-home --no-log-init app
16+
RUN addgroup -S app && adduser -S -G app app
2717
USER app
2818

2919
WORKDIR /app
@@ -32,4 +22,4 @@ COPY --from=builder --chown=app:app /app/.venv /app/.venv
3222
COPY src/ /app
3323
COPY docker/ /app
3424

35-
CMD ["/bin/bash", "start.sh"]
25+
CMD ["/bin/sh", "start.sh"]

0 commit comments

Comments
 (0)