Spaces:
Sleeping
Sleeping
Commit ·
1984ccf
1
Parent(s): 387867f
Update Dockerfile
Browse files- Dockerfile +17 -8
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM circulartextapp/spaceread
|
| 3 |
|
| 4 |
# Set the working directory to /app
|
| 5 |
WORKDIR /app
|
|
@@ -19,18 +19,27 @@ 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 && chmod -R
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Set the entrypoint script as executable
|
| 28 |
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
| 29 |
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 30 |
|
| 31 |
-
# Switch to the user for improved security
|
| 32 |
-
USER user
|
| 33 |
-
|
| 34 |
# Define the entrypoint script to handle user creation and application startup
|
| 35 |
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
| 36 |
|
|
|
|
| 1 |
+
# Use the base Docker image with necessary dependencies
|
| 2 |
+
FROM circulartextapp/spaceread as base
|
| 3 |
|
| 4 |
# Set the working directory to /app
|
| 5 |
WORKDIR /app
|
|
|
|
| 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
|
| 41 |
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 42 |
|
|
|
|
|
|
|
|
|
|
| 43 |
# Define the entrypoint script to handle user creation and application startup
|
| 44 |
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
| 45 |
|