Skip to content

Commit

Permalink
deploy: Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
giovanni-orciuolo committed Feb 13, 2024
1 parent 23fcda0 commit 97e8616
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ export const VisualizeBattle= () => {
function joinButton() {
const now = new Date()
const startDate= new Date(battle?.startsAt ?? now)
const endDate= new Date(battle?.endsAt ?? now)
if(compareDate(now,startDate) == 2 || compareDate(now,endDate)==1)
if(compareDate(now,startDate) == 1 || compareDate(now,startDate) == 0)
return (<></>)
return (<button style={{width:"100%"}} className="btn btn-success" onClick={() => joinBattle()}>Join</button>)
}
Expand Down
16 changes: 0 additions & 16 deletions IT/codekatabattle/.run/All Tests.run.xml

This file was deleted.

28 changes: 28 additions & 0 deletions IT/codekatabattle/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp

ARG MAVEN_VERSION=3.9.6
ARG USER_HOME_DIR="/root"
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

# Update and install curl
RUN apk update; apk add curl

# Install Bash
RUN apk update && apk add bash

# Install Maven
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

# Export Maven environment variables
ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

COPY target/*.jar app.jar

ENTRYPOINT ["java", "-jar", "/app.jar"]
EXPOSE 8000

0 comments on commit 97e8616

Please sign in to comment.