-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (40 loc) · 1.4 KB
/
Dockerfile
File metadata and controls
53 lines (40 loc) · 1.4 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Install uv
FROM python:3.13-slim-bookworm
# Metadata for clarity and documentation
LABEL maintainer="dashstrom.pro@gmail.com"
LABEL description="Docker image for easterobot, a discord bot for easter events"
# The installer requires curl (and certificates) to download the release archive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
libopenblas-dev \
libjpeg-dev zlib1g-dev libtiff-dev libfreetype6-dev \
liblcms2-dev libwebp-dev tcl-dev tk-dev \
libopenjp2-7-dev libimagequant-dev \
libxcb1-dev libavif-dev \
libharfbuzz-dev libfribidi-dev libraqm-dev \
curl
# INstall UV
RUN curl -LsSf https://astral.sh/uv/0.8.7/install.sh | env UV_INSTALL_DIR="/bin" sh
# Add non-root user
RUN useradd --create-home easterobot
# Create directory
RUN mkdir /data && chown easterobot:easterobot /data
# Change the working directory to the `src` directory
WORKDIR /src
# Copy only project definition files (improves caching)
COPY pyproject.toml ./
# Install dependencies
RUN uv sync --no-install-project
# Copy the project into the image
COPY . .
# Fix permissions
RUN find /src -type d -exec chmod 755 {} \; \
&& find /src -type f -exec chmod 644 {} \; \
&& chmod +x /src/entrypoint.sh
# Sync the project
RUN uv sync --frozen
# Use non-root user for security
USER easterobot
# Default command (use exec form for signal handling)
CMD ["/src/entrypoint.sh"]