1- FROM python:3.11 AS base
1+ FROM python:3.11-slim AS base
22
33ENV PYTHONUNBUFFERED 1
44
55# RUN dpkg --add-architecture i386
66RUN apt-get update && \
7- apt-get install -y \
7+ apt-get install --no-install-recommends - y \
88 git \
99 libpq-dev \
1010 postgresql-client \
@@ -16,9 +16,13 @@ RUN apt-get update && \
1616 texlive-lang-european \
1717 texlive-lang-czechslovak \
1818 texlive-pstricks \
19- ghostscript \
2019 texlive-fonts-recommended \
20+ tex-gyre \
21+ ghostscript \
22+ make \
2123 gcc \
24+ g++ \
25+ libc6-dev \
2226 sudo \
2327 libstdc++6 \
2428 zlib1g \
@@ -28,7 +32,8 @@ RUN apt-get update && \
2832 python3-pip \
2933 nodejs \
3034 npm && \
31- apt-get clean
35+ apt-get clean && \
36+ rm -rf /usr/share/doc/texlive*
3237
3338# This is oioioi user linux uid. Setting it is useful in development.
3439# By default we use an unused uid of 1234.
@@ -75,7 +80,7 @@ WORKDIR /sio2/deployment
7580RUN mkdir -p /sio2/deployment/logs/{supervisor,runserver}
7681
7782# The stage below is independent of base and can be built in parallel to optimize build time.
78- FROM python:3.11 AS development-sandboxes
83+ FROM python:3.11-slim AS development-sandboxes
7984
8085ENV DOWNLOAD_DIR=/sio2/sandboxes
8186ENV MANIFEST_URL=https://downloads.sio2project.mimuw.edu.pl/sandboxes/Manifest
@@ -84,7 +89,7 @@ ENV MANIFEST_URL=https://downloads.sio2project.mimuw.edu.pl/sandboxes/Manifest
8489ADD $MANIFEST_URL /sio2/Manifest
8590
8691RUN apt-get update && \
87- apt-get install -y curl wget bash && \
92+ apt-get install --no-install-recommends - y curl wget bash && \
8893 apt-get clean
8994
9095COPY download_sandboxes.sh /download_sandboxes.sh
@@ -93,14 +98,19 @@ RUN chmod +x /download_sandboxes.sh
9398# Run script to download sandbox data from the given Manifest.
9499RUN ./download_sandboxes.sh -q -y -d $DOWNLOAD_DIR -m $MANIFEST_URL
95100
96- FROM base AS development
97-
101+ # For production (or dev with filetracker): Upload sandboxes to built-in filetracker during build
102+ # For dev: The sandboxes will be re-uploaded to s3dedup at runtime via oioioi_init.sh
103+ FROM base AS base_with_sandboxes
98104COPY --from=development-sandboxes /sio2/sandboxes /sio2/sandboxes
99- RUN chmod +x /sio2/oioioi/download_sandboxes.sh
100105
101- # For production: Upload sandboxes to built-in filetracker during build
102- # For dev: These will be re-uploaded to s3dedup at runtime via oioioi_init.sh
103- RUN ./manage.py supervisor > /dev/null --daemonize -- nolaunch=uwsgi && \
106+ FROM base_with_sandboxes AS base_with_populated_filetracker
107+ RUN ./manage.py supervisor > /dev/null --daemonize \
108+ -- nolaunch={ uwsgi,unpackmgr,evalmgr,rankingsd,mailnotifyd,sioworkersd,receive_from_workers} && \
104109 /sio2/oioioi/wait-for-it.sh -t 60 "127.0.0.1:9999" && \
105110 ./manage.py upload_sandboxes_to_filetracker -d /sio2/sandboxes && \
106111 ./manage.py supervisor stop all
112+
113+ FROM base_with_sandboxes AS development
114+
115+ FROM base AS development_filetracker
116+ COPY --from=base_with_populated_filetracker /sio2/deployment/media /sio2/deployment/media
0 commit comments