-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 967 Bytes
/
Dockerfile
File metadata and controls
29 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
FROM python:3.12-slim AS build
RUN python3 -m venv /opt/build-tools
RUN /opt/build-tools/bin/pip install -U pip
RUN /opt/build-tools/bin/pip install pip-tools build
COPY . /usr/src/juudge
WORKDIR /usr/src/juudge
RUN /opt/build-tools/bin/pip-compile \
--quiet \
--generate-hashes \
--strip-extras \
--output-file /requirements.txt
RUN python3 -m venv /opt/juudge
RUN /opt/juudge/bin/pip install -U pip
RUN /opt/juudge/bin/pip install --no-deps --requirement /requirements.txt
RUN /opt/juudge/bin/pip install --no-deps /usr/src/juudge
FROM python:3.12-slim AS prod
COPY ./docker-resources/main.bash /opt/juudge/bin/juudge-main.bash
COPY ./docker-resources/logging.yaml /opt/juudge/etc/logging.yaml
RUN chmod +x /opt/juudge/bin/juudge-main.bash
COPY --from=build /opt/juudge /opt/juudge
COPY --from=build /requirements.txt /opt/juudge/requirements.txt
RUN mkdir /opt/juudge/logs
WORKDIR /
EXPOSE 8000
ENTRYPOINT ["/opt/juudge/bin/juudge-main.bash"]