-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
36 lines (25 loc) · 866 Bytes
/
Dockerfile
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
FROM python:3.12 AS builder
ADD . /build/
WORKDIR /build
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/
RUN uv pip install --system --no-cache -e '.[dev]'
RUN python -m build --wheel --outdir dist
FROM python:3.12
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/
RUN set -ex && \
apt-get -y update && \
apt-get -y install --no-install-recommends ghostscript && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
# create an unprivileged user to run as
RUN set -ex && \
groupadd -r openreferee && \
useradd -r -g openreferee -m -d /openreferee openreferee
RUN uv pip install --system --no-cache uwsgi
COPY --from=builder /build/dist/openreferee*.whl /tmp/
RUN uv pip install --system --no-cache $(echo /tmp/openreferee*.whl)
ADD docker/run.sh docker/uwsgi.ini /
USER openreferee
ENV FLASK_APP=openreferee_server.wsgi
CMD ["/run.sh"]
EXPOSE 8080