Improve container
This commit is contained in:
parent
1150bc160a
commit
fc1f96a0e4
1 changed files with 13 additions and 5 deletions
|
@ -1,14 +1,22 @@
|
||||||
# Build: podman build -t code.philo.ydns.eu/philorg/sms-handler -f Containerfile
|
# Build: podman build -t code.philo.ydns.eu/philorg/sms-handler -f Containerfile
|
||||||
|
|
||||||
FROM docker.io/python:3.12-alpine
|
FROM docker.io/python:alpine
|
||||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/
|
|
||||||
|
|
||||||
ENV PORT=8025
|
ENV PORT=8025
|
||||||
ENV LISTEN_ADDR=0.0.0.0
|
ENV LISTEN_ADDR=0.0.0.0
|
||||||
ENV SMS_HANDLER_MAIL_SERVER=host.containers.internal
|
ENV SMS_HANDLER_MAIL_SERVER=host.containers.internal
|
||||||
|
|
||||||
COPY . /src
|
COPY . /app
|
||||||
WORKDIR /src
|
ENV UV_LINK_MODE=copy
|
||||||
RUN uv sync --frozen --no-cache && uv pip install --system .
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Sync the project into a new environment, using the frozen lockfile
|
||||||
|
RUN \
|
||||||
|
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/local/bin/uv,target=/bin/uv \
|
||||||
|
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/lib/libpcre2-8.so.0,target=/usr/lib/libpcre2-8.so.0 \
|
||||||
|
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/bin/git,target=/usr/bin/git \
|
||||||
|
--mount=type=cache,target=/root/.cache/uv \
|
||||||
|
uv sync --frozen --no-cache && uv pip install --system .
|
||||||
|
|
||||||
CMD sms-handler --port ${PORT} --host ${LISTEN_ADDR}
|
CMD sms-handler --port ${PORT} --host ${LISTEN_ADDR}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue