fix: docker build

This commit is contained in:
2026-03-23 12:17:50 +01:00
parent 421047aec2
commit d7df0d0e50
12 changed files with 170 additions and 125 deletions
+18 -12
View File
@@ -1,20 +1,26 @@
FROM python:3.13-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
FROM python:3.13-alpine3.23 as builder
ENV UV_SYSTEM_PYTHON=1
COPY pyproject.toml .
RUN pip install uv && uv pip install -r pyproject.toml
RUN mkdir /code
FROM python:3.13-alpine3.23
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
WORKDIR /code
COPY pyproject.toml /code
RUN apt-get update && \
apt-get install -y gcc git nginx gettext vim libpq-dev && \
pip install uv && \
uv pip install -r pyproject.toml && \
apt-get autoremove -y
# Set user and group
ARG user=apps
ARG uid=1001
ARG gid=1001
RUN groupadd -g ${gid} ${user}
RUN useradd -u ${uid} -g ${user} -s /bin/sh -m ${user}
COPY . /code
RUN apk update && apk add gcc gettext vim libpq-dev
RUN chown -R ${user}:${user} /code
USER ${user}
COPY --chown=${user}:${user} . /code
RUN ["sh", "./scripts/prebuild.sh"]
CMD ["sh", "./scripts/run.sh"]