Skip to content

Commit

Permalink
Update the Dockerfile for the judger component.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxie committed Mar 31, 2023
1 parent dfbc553 commit a0d54c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can use Verwandlung Online Judge with ONLY 4 bash commands.
docker pull zjhzxhz/voj.web
docker pull zjhzxhz/voj.judger
docker run -d --name voj.web -p 8080:8080 zjhzxhz/voj.web
docker run -d --name voj.judger voj.web zjhzxhz/voj.judger
docker run -d --name voj.judger --link voj.web zjhzxhz/voj.judger
```

[Tell me more](https://github.com/hzxie/voj/tree/master/docker) about voj@Docker.
Expand Down
25 changes: 11 additions & 14 deletions docker/judger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile for Verwandlung Online Judge - Judger
FROM ubuntu:22.04
MAINTAINER Haozhe Xie "cshzxie@gmail.com"
MAINTAINER Haozhe Xie "root@haozhexie.com"

# User Settings
ARG MYSQL_USER_PASS=U3bEwhRHnD6xNVpb
Expand All @@ -11,21 +11,22 @@ ARG ACTIVEMQ_PORT=61616

# Set environment variables.
ENV HOME /root
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64
ENV M2_HOME /opt/maven

# Define working directory.
WORKDIR /root

# Install Java
RUN apt-get update
RUN apt-get install -y openjdk-11-jdk

# Install Java and Python
RUN apt-get update && \
apt-get install -y git wget make g++ openjdk-17-jdk python3 && \
# Setup Python3 as the default Python
ln -s /usr/bin/python3 /usr/bin/python && \
# Install Maven
RUN wget http://mirrors.tencent.com/apache/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz && \
tar -xf apache-maven-3.8.5-bin.tar.gz -C /opt && \
rm apache-maven-3.8.5-bin.tar.gz
RUN mv /opt/apache-maven-3.8.5 /opt/maven
wget http://mirrors.tencent.com/apache/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.tar.gz && \
tar -xf apache-maven-3.9.1-bin.tar.gz -C /opt && \
rm apache-maven-3.9.1-bin.tar.gz && \
mv /opt/apache-maven-3.9.1 /opt/maven

# Setup Judger Project
RUN git clone https://github.com/hzxie/voj.git && \
Expand All @@ -36,9 +37,5 @@ RUN git clone https://github.com/hzxie/voj.git && \
mkdir -p voj/target/classes && \
$M2_HOME/bin/mvn package -DskipTests -f voj/judger/pom.xml

# Setup Compliers
RUN apt-get install -y python3
RUN ln -s /usr/bin/python3 /usr/bin/python

# Run Judger
CMD ["java", "-jar", "voj/judger/target/voj.judger.jar"]
1 change: 1 addition & 0 deletions web/src/main/webapp/WEB-INF/views/include/footer.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<a href="https://github.com/hzxie/voj/">
<img src="https://img.shields.io/github/stars/hzxie/voj.svg?style=social&label=Stars" alt="GitHub-Stars">
</a>
<img src="https://badge.haozhexie.com/count?name=voj" alt="Visitors">
</p>
</div> <!-- .container -->
</div> <!-- #footer -->

0 comments on commit a0d54c5

Please sign in to comment.