-
Notifications
You must be signed in to change notification settings - Fork 73
/
Dockerfile
40 lines (29 loc) · 969 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
37
38
39
40
# builder image
FROM python:3.12 AS builder
ADD . /build/
WORKDIR /build
RUN ./install_node.sh
RUN HUSKY_SKIP_INSTALL=1 make
RUN make build
# production image
FROM python:3.12
# create an unprivileged user to run as
RUN set -ex && \
groupadd -r newdle && \
useradd -r -g newdle -m -d /newdle newdle
# required packages for uwsgi to build
RUN apt-get update && apt-get install -y libpcre3 libpcre3-dev
RUN pip install uwsgi
ENV UV_NO_CACHE=1
ENV UV_SYSTEM_PYTHON=1
COPY --from=ghcr.io/astral-sh/uv /uv /bin/uv
COPY --from=builder /build/dist/newdle*.whl /tmp/
RUN uv pip install $(echo /tmp/newdle*.whl)[exchange,cern]
RUN find /usr/local/lib/python3.12/site-packages/newdle/client/build/ -type f -exec gzip -k {} +
ADD docker/run.sh docker/uwsgi.ini /
# install some useful tools for debugging etc.
RUN uv pip install ipython flask-shell-ipython httpie
USER newdle
ENV NEWDLE_CONFIG=/newdle/etc/newdle.cfg FLASK_APP=newdle.wsgi
CMD ["/run.sh"]
EXPOSE 8080