summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index 6346a940..f8de6b54 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,15 +2,19 @@ FROM gradle:alpine
MAINTAINER Fabian Mastenbroek <f.s.mastenbroek@student.tudelft.nl>
# Copy OpenDC simulator
-COPY ./ /simulator
+COPY ./ /home/gradle/simulator
# Fix permissions
USER root
-RUN chown -R gradle:gradle /simulator
+RUN chown -R gradle:gradle /home/gradle/simulator && \
+ chmod -R 771 /home/gradle/simulator
USER gradle
# Set the working directory to the JPA integration
-WORKDIR /simulator/opendc-integration-jpa
+WORKDIR /home/gradle/simulator/opendc-integration-jpa
+
+# Build the application
+RUN gradle --no-daemon installDist
# Run the application
-CMD ["/bin/sh", "-c", "gradle run -Ppersistence.url=$(echo \"jdbc:mysql://mariadb:3306/\"$MYSQL_DATABASE) -Ppersistence.user=$MYSQL_USER -Ppersistence.password=$MYSQL_PASSWORD"]
+CMD build/install/opendc-integration-jpa/bin/opendc-integration-jpa