forked from judge0/judge0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (40 loc) · 1.29 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM judge0/compilers:1.4.0 AS production
ENV JUDGE0_HOMEPAGE "https://judge0.com"
LABEL homepage=$JUDGE0_HOMEPAGE
ENV JUDGE0_SOURCE_CODE "https://github.com/judge0/judge0"
LABEL source_code=$JUDGE0_SOURCE_CODE
ENV JUDGE0_MAINTAINER "Herman Zvonimir Došilović <[email protected]>"
LABEL maintainer=$JUDGE0_MAINTAINER
ENV PATH "/usr/local/ruby-2.7.0/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:2.1.4 && \
npm install -g --unsafe-perm [email protected]
ENV VIRTUAL_PORT 2358
EXPOSE $VIRTUAL_PORT
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"]
ENV JUDGE0_VERSION "1.13.0"
LABEL version=$JUDGE0_VERSION
FROM production AS development
ARG DEV_USER=judge0
ARG DEV_USER_ID=1000
RUN apt-get update && \
apt-get install -y --no-install-recommends \
vim && \
useradd -u $DEV_USER_ID -m -r $DEV_USER && \
echo "$DEV_USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
USER $DEV_USER
CMD ["sleep", "infinity"]