fixing permissions to be able to run springboot with given UID and GID (#864)
Co-authored-by: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com>
This commit is contained in:
co-authored by
Aditya Chandel
parent
978bd05b1e
commit
43b4e6cb7a
+2
-2
@@ -27,7 +27,7 @@ RUN gradle clean build
|
|||||||
# Stage 3: Final image
|
# Stage 3: Final image
|
||||||
FROM eclipse-temurin:21-jre-alpine
|
FROM eclipse-temurin:21-jre-alpine
|
||||||
|
|
||||||
RUN apk update && apk add nginx
|
RUN apk update && apk add nginx su-exec
|
||||||
|
|
||||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY --from=angular-build /angular-app/dist/booklore/browser /usr/share/nginx/html
|
COPY --from=angular-build /angular-app/dist/booklore/browser /usr/share/nginx/html
|
||||||
@@ -36,4 +36,4 @@ COPY --from=springboot-build /springboot-app/build/libs/booklore-api-0.0.1-SNAPS
|
|||||||
EXPOSE 8080 80
|
EXPOSE 8080 80
|
||||||
|
|
||||||
CMD /usr/sbin/nginx -g "daemon off;" & \
|
CMD /usr/sbin/nginx -g "daemon off;" & \
|
||||||
java -jar /app/app.jar
|
su-exec ${PUID:-0}:${PGID:-0} java -jar /app/app.jar
|
||||||
@@ -5,6 +5,7 @@ BOOKLORE_IMAGE_TAG=latest
|
|||||||
|
|
||||||
# User and Timezone Settings
|
# User and Timezone Settings
|
||||||
# PUID and PGID define the user/group running the container.
|
# PUID and PGID define the user/group running the container.
|
||||||
|
# Avoid using "user" property because system won't work with it.
|
||||||
# TZ sets the timezone for correct time-related operations.
|
# TZ sets the timezone for correct time-related operations.
|
||||||
PUID=1000 # Default user ID (Check with `id -u` on Linux/Mac)
|
PUID=1000 # Default user ID (Check with `id -u` on Linux/Mac)
|
||||||
PGID=1000 # Default group ID (Check with `id -g` on Linux/Mac)
|
PGID=1000 # Default group ID (Check with `id -g` on Linux/Mac)
|
||||||
|
|||||||
Reference in New Issue
Block a user