mirror of
https://github.com/UnlegitDqrk/Potato.git
synced 2025-10-01 22:30:14 +02:00
Docker build - Just for fun (#203)
* 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
This commit is contained in:
27
Dockerfile.spud
Normal file
27
Dockerfile.spud
Normal file
@@ -0,0 +1,27 @@
|
||||
########### 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}"]
|
Reference in New Issue
Block a user