-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (32 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
40 lines (32 loc) · 1.02 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
FROM ubuntu:24.04
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ARG RUNTIME_USER="koa"
ARG RUNTIME_USER_UID=4583
ARG APP_HOME="/koa"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y python3 python3-venv librrd-dev libpython3-dev build-essential && \
rm -rf /var/lib/apt/lists/* && \
mkdir /data && \
mkdir -p $APP_HOME/static && \
useradd $RUNTIME_USER -u $RUNTIME_USER_UID && \
usermod $RUNTIME_USER -d $APP_HOME
WORKDIR $APP_HOME
COPY pyproject.toml uv.lock README.md .
ENV VIRTUAL_ENV=$APP_HOME/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN uv sync --frozen --no-dev --no-install-project --no-editable --link-mode=copy
COPY css $APP_HOME/css
COPY js $APP_HOME/js
COPY static/images $APP_HOME/static/images
COPY backend.py \
index.html \
LICENSE \
NOTICE \
$APP_HOME/
RUN chown -R $RUNTIME_USER:$RUNTIME_USER $APP_HOME && \
chown -R $RUNTIME_USER:$RUNTIME_USER /data
VOLUME ["/data"]
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENTRYPOINT ["python3", "-u", "./backend.py"]