Update Dockerfile
Browse files- Dockerfile +5 -5
Dockerfile
CHANGED
|
@@ -14,6 +14,9 @@ ENV POETRY_VERSION=1.8.4 \
|
|
| 14 |
PORT=7860 \
|
| 15 |
NODE_ENV=production
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
# Install system dependencies and set up locales
|
| 18 |
RUN apt-get update && apt-get install -y \
|
| 19 |
curl \
|
|
@@ -120,7 +123,8 @@ RUN mkdir -p /var/log/nginx /var/run/postgresql /var/lib/postgresql/data /var/lo
|
|
| 120 |
chmod -R 755 /var/lib/nginx && \
|
| 121 |
chmod -R 777 /run && \
|
| 122 |
chmod 700 /var/lib/postgresql/data && \
|
| 123 |
-
chmod 777 /data /app
|
|
|
|
| 124 |
|
| 125 |
# Create and configure entrypoint script
|
| 126 |
COPY <<-'EOT' /app/entrypoint.sh
|
|
@@ -249,10 +253,6 @@ EOT
|
|
| 249 |
RUN chmod +x /app/entrypoint.sh && \
|
| 250 |
chown user:user /app/entrypoint.sh
|
| 251 |
|
| 252 |
-
# Create user after setting up all files and permissions
|
| 253 |
-
RUN useradd -m -u 1000 user && \
|
| 254 |
-
chown -R user:user /var/run/postgresql /var/lib/postgresql/data /var/log/postgresql /app /data /var/log/nginx
|
| 255 |
-
|
| 256 |
# Switch to user for remaining operations
|
| 257 |
USER user
|
| 258 |
|
|
|
|
| 14 |
PORT=7860 \
|
| 15 |
NODE_ENV=production
|
| 16 |
|
| 17 |
+
# Create user first (HF Spaces requirement)
|
| 18 |
+
RUN useradd -m -u 1000 user
|
| 19 |
+
|
| 20 |
# Install system dependencies and set up locales
|
| 21 |
RUN apt-get update && apt-get install -y \
|
| 22 |
curl \
|
|
|
|
| 123 |
chmod -R 755 /var/lib/nginx && \
|
| 124 |
chmod -R 777 /run && \
|
| 125 |
chmod 700 /var/lib/postgresql/data && \
|
| 126 |
+
chmod 777 /data /app && \
|
| 127 |
+
chown -R user:user /var/run/postgresql /var/lib/postgresql/data /var/log/postgresql /app /data /var/log/nginx
|
| 128 |
|
| 129 |
# Create and configure entrypoint script
|
| 130 |
COPY <<-'EOT' /app/entrypoint.sh
|
|
|
|
| 253 |
RUN chmod +x /app/entrypoint.sh && \
|
| 254 |
chown user:user /app/entrypoint.sh
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
# Switch to user for remaining operations
|
| 257 |
USER user
|
| 258 |
|