Update Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:22.04
|
| 2 |
+
|
| 3 |
+
# Set environment variables
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
|
| 6 |
+
# Install required dependencies
|
| 7 |
+
RUN apt update && apt install -y \
|
| 8 |
+
wget unzip sudo docker.io docker-compose \
|
| 9 |
+
&& apt clean && rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Download and extract Judge0
|
| 12 |
+
WORKDIR /app
|
| 13 |
+
RUN wget https://github.com/judge0/judge0/releases/download/v1.13.1/judge0-v1.13.1.zip \
|
| 14 |
+
&& unzip judge0-v1.13.1.zip \
|
| 15 |
+
&& rm judge0-v1.13.1.zip
|
| 16 |
+
|
| 17 |
+
# Set up environment variables (replace these with secure passwords)
|
| 18 |
+
ENV REDIS_PASSWORD="your_secure_redis_password"
|
| 19 |
+
ENV POSTGRES_PASSWORD="your_secure_postgres_password"
|
| 20 |
+
|
| 21 |
+
# Update config with passwords
|
| 22 |
+
RUN sed -i "s/^REDIS_PASSWORD=.*/REDIS_PASSWORD=${VThWe3JHKgPLQBEDSgGA6KctAPftZpUf}/" /app/judge0-v1.13.1/judge0.conf \
|
| 23 |
+
&& sed -i "s/^POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=${vrcUWCuCmExLJUw2Ea5GHpFhA6g3LpXa}/" /app/judge0-v1.13.1/judge0.conf
|
| 24 |
+
|
| 25 |
+
# Expose the necessary ports
|
| 26 |
+
EXPOSE 2358
|
| 27 |
+
|
| 28 |
+
# Start Judge0 services
|
| 29 |
+
CMD cd /app/judge0-v1.13.1 && \
|
| 30 |
+
docker-compose up -d db redis && \
|
| 31 |
+
sleep 10s && \
|
| 32 |
+
docker-compose up -d && \
|
| 33 |
+
tail -f /dev/null
|