Prajith04 commited on
Commit
56311f6
·
verified ·
1 Parent(s): 4620832

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -18
Dockerfile CHANGED
@@ -8,26 +8,14 @@ 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
 
8
  wget unzip sudo docker.io docker-compose \
9
  && apt clean && rm -rf /var/lib/apt/lists/*
10
 
 
11
  WORKDIR /app
 
 
 
12
 
 
 
 
13
 
14
+ COPY --chown=user ./docker-compose.yml docker-compose.yml
15
+ COPY --chown-user ./judge0.conf judge0.conf
 
16
 
17
+ CMD docker-compose up -d db redis \
18
+ sleep 10s \
19
+ docker-compose up -d \
20
+ sleep 5s
21