forked from judge0/judge0
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (34 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
49 lines (34 loc) · 1.2 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
41
42
43
44
45
46
47
48
49
FROM --platform=linux/amd64 ghcr.io/dimiplan/compilers:latest AS production
ENV JUDGE0_FORK_SOURCE_CODE="https://github.com/dimiplan/judge0"
LABEL source_code=$JUDGE0_FORK_SOURCE_CODE
ENV JUDGE0_FORK_MAINTAINER="dimiplan <admin@dimiplan.com>"
LABEL maintainer=$JUDGE0_FORK_MAINTAINER
ENV PATH="/usr/local/ruby-3.4.7/bin:/usr/local/bun-1.3.1/bin:/opt/.gem/bin:$PATH"
ENV GEM_HOME="/opt/.gem/"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cron \
libpq-dev \
sudo && \
rm -rf /var/lib/apt/lists/* && \
echo "gem: --no-document" > /root/.gemrc && \
gem install bundler && \
bun install -g --unsafe-perm aglio@2.3.0
EXPOSE 2358
WORKDIR /api
COPY Gemfile* ./
RUN RAILS_ENV=production bundle
COPY cron /etc/cron.d
RUN cat /etc/cron.d/* | crontab -
COPY . .
ENTRYPOINT ["/api/docker-entrypoint.sh"]
CMD ["/api/scripts/server"]
RUN useradd -u 1000 -m -r judge0 && \
echo "judge0 ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \
chown judge0: /api/tmp/
USER judge0
ENV JUDGE0_VERSION="1.14.1"
LABEL version=$JUDGE0_VERSION
LABEL org.opencontainers.image.source="https://github.com/dimiplan/judge0"
FROM production AS development
CMD ["sleep", "infinity"]