-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (20 loc) · 718 Bytes
/
Dockerfile
File metadata and controls
35 lines (20 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# syntax=docker/dockerfile:1
ARG APP_VERSION
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS compile-image
ARG APP_VERSION
RUN if [ -n "$APP_VERSION" ]; then echo "Building for version $APP_VERSION"; else echo "ERROR: APP_VERSION not set" && false; fi
WORKDIR /app
COPY . .
RUN ./init.sh
FROM python:3.13-slim AS build-image
ARG APP_VERSION
RUN groupadd -g 10001 nonroot && \
useradd nonroot -u 10001 -g 10001
COPY --from=compile-image /bin/ffmpeg /bin/ffmpeg
COPY --chown=nonroot:nonroot --from=compile-image /app /app
WORKDIR /app
# Set XDG_CACHE_HOME for gallery-dl usage
ENV XDG_CACHE_HOME=/app/volume
ENV APP_VERSION=$APP_VERSION
USER nonroot
ENTRYPOINT ["/app/.venv/bin/my-discord-bot"]