-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
34 lines (25 loc) · 967 Bytes
/
dockerfile
File metadata and controls
34 lines (25 loc) · 967 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
FROM python:3.13-trixie
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# run the container as a non-root user
ARG UID=1000
ARG GID=1000
# Create a non-root user
RUN groupadd -g $GID transcode_tycoon && \
useradd -u $UID -m -g transcode_tycoon transcode_tycoon
USER transcode_tycoon
ENV PATH="/home/transcode_tycoon/.local/bin:${PATH}"
WORKDIR /home/transcode_tycoon
# Copy over project files
COPY --chown=transcode_tycoon:transcode_tycoon ./pyproject.toml ./
COPY --chown=transcode_tycoon:transcode_tycoon ./transcode_tycoon ./transcode_tycoon
COPY --chown=transcode_tycoon:transcode_tycoon ./tests ./tests
RUN mkdir ./logs && chown -R transcode_tycoon:transcode_tycoon /home/transcode_tycoon/logs
# install depdendencies
RUN pip3 install --user uv && uv sync
# run unit tests
RUN uv run pytest -s
# make sure we're not running as root
HEALTHCHECK --interval=30s --timeout=3s \
CMD [ "$(id -u)" -ne 0 ] || exit 1
CMD uv run -m transcode_tycoon