-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 799 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# syntax=docker/dockerfile:1
# Use gradle image
FROM gradle:7.5-jdk17-alpine AS build
# Copy source code into the container
COPY --chown=gradle:gradle . /home/gradle/src
# Change the working directory
WORKDIR /home/gradle/src
# Run build: includes linters, tests, generating .jar file
RUN gradle build --no-daemon
# Use jdk image
FROM openjdk:17-jdk-alpine
# Expose a port container uses
EXPOSE 8080
# Create a folder for .jar file
RUN mkdir /app
# Copy .jar file into 'app' folder
COPY --from=build /home/gradle/src/build/libs/*.jar /app/innoqueue-0.0.1-SNAPSHOT.jar
# Add and use non root user
RUN adduser --system --no-create-home server
USER server
# Entrypoint for running .jar file which is actually our web application
ENTRYPOINT ["java","-jar","/app/innoqueue-0.0.1-SNAPSHOT.jar"]