mirror of
https://github.com/UnlegitDqrk/Potato.git
synced 2025-10-01 22:30:14 +02:00
* Adding files to run in docker * Updating build and run scripts with usage * Updating build and run scripts to check for docker * Fixing commented code * Added docker compose file and added instructions
28 lines
716 B
Docker
28 lines
716 B
Docker
########### Phase 1 - Compile ###########
|
|
FROM maven:3.9.8-eclipse-temurin-8-alpine AS potato-builder
|
|
|
|
# Set the working directory and copy src
|
|
WORKDIR /usr/src/Potato
|
|
COPY . /usr/src/Potato/
|
|
|
|
# Build with Maven
|
|
RUN mvn clean install;
|
|
|
|
########### Phase 2 - Package ###########
|
|
FROM eclipse-temurin:21
|
|
|
|
# Can be overridden with `docker run -e VEGAN="--vegan"`
|
|
ENV VEGAN=""
|
|
|
|
# Make am appropriate user name
|
|
RUN useradd -u 500 mrpotatohead
|
|
USER mrpotatohead
|
|
|
|
WORKDIR /home/mrpotatohead
|
|
|
|
# Cook this potato right every time
|
|
COPY --from=potato-builder /usr/src/Potato/target /home/mrpotatohead/target
|
|
|
|
# Allow user to pass in an argument when running the container
|
|
CMD ["sh","-c","java -jar target/Potato.jar ${VEGAN}"]
|