Verified Commit b1f233c6 authored by Lukas Wiest's avatar Lukas Wiest 🚂
Browse files

refactor(dockerfile) major rework

- based on openjdk:11-jre-slim instead of a base system and
    installing java manually
- removed git installation, we use a maven library for this
    no system installed git needed for anything
- removed this damn proxy env vars
    they have nothing to do baked into an docker image!!
- removed junit downloads
    not needed in backend. The testrunners are responsible
    for what they need
- removed setting of a specific profile
    in prod always the default one should be active,
    use a different profile on your dev machine which you
    DO NOT commit
parent 4926b058
#Dockerfile
#base image
FROM alpine
FROM openjdk:11-jre-slim
#Proxy
ENV http_proxy 'http://proxy.hft-stuttgart.de:80'
ENV https_proxy 'http://proxy.hft-stuttgart.de:80'
#jdk11
RUN apk add openjdk11 git
VOLUME /tmp
ADD target/modocot-backend-1.0.2-SNAPSHOT.jar app.jar
RUN sh -c 'touch /app.jar'
ADD target/modocot-backend.jar app.jar
# Prepare environment.
# Create needed folders
RUN mkdir /home/modocot && \
mkdir /home/modocot/libs
RUN mkdir /modocot && \
mkdir /modocot/data && \
mkdir /modocot/config
VOLUME /modocot/data
# Download needed libs for compilation
ADD https://repo1.maven.org/maven2/junit/junit/4.13/junit-4.13.jar /home/modocot/libs/junit.jar
ADD https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/2.2/hamcrest-core-2.2.jar /home/modocot/libs/hamcrest.jar
env SPRING_CONFIG_ADDITIONAL_LOCATION "file:/home/modocot/config/"
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=server","-jar","/app.jar"]
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment