Spaces:
Sleeping
Sleeping
Commit
·
8d7f247
1
Parent(s):
b959ebe
Update Dockerfile
Browse files- Dockerfile +12 -4
Dockerfile
CHANGED
@@ -19,14 +19,22 @@ RUN if id "$USER_ID" >/dev/null 2>&1; then \
|
|
19 |
fi
|
20 |
|
21 |
# Set appropriate permissions for the application directory
|
22 |
-
RUN chown -R user:user /app
|
23 |
|
24 |
# Switch to the user for improved security
|
25 |
USER user
|
26 |
|
27 |
-
#
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
# Set the entrypoint script as executable
|
32 |
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
19 |
fi
|
20 |
|
21 |
# Set appropriate permissions for the application directory
|
22 |
+
RUN chown -R user:user /app && chmod -R 755 /app
|
23 |
|
24 |
# Switch to the user for improved security
|
25 |
USER user
|
26 |
|
27 |
+
# Intermediate image with additional packages
|
28 |
+
FROM debian:bullseye-slim as packages
|
29 |
+
|
30 |
+
# Install gosu using apt-get
|
31 |
+
RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
|
32 |
+
|
33 |
+
# Final image
|
34 |
+
FROM base
|
35 |
+
|
36 |
+
# Copy gosu from the packages image
|
37 |
+
COPY --from=packages /usr/sbin/gosu /usr/sbin/gosu
|
38 |
|
39 |
# Set the entrypoint script as executable
|
40 |
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|