Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
|
@@ -28,11 +28,17 @@ RUN chmod +x /app/start.sh
|
|
| 28 |
# We need to make sure the data directory is writable by UID 1000.
|
| 29 |
|
| 30 |
# Create the data directory and give permissions to UID 1000
|
|
|
|
|
|
|
|
|
|
| 31 |
RUN mkdir -p /var/lib/postgresql/data && \
|
| 32 |
-
chown -R
|
| 33 |
chmod 700 /var/lib/postgresql/data
|
| 34 |
|
| 35 |
-
#
|
|
|
|
|
|
|
|
|
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
# Set the entrypoint to our custom script
|
|
|
|
| 28 |
# We need to make sure the data directory is writable by UID 1000.
|
| 29 |
|
| 30 |
# Create the data directory and give permissions to UID 1000
|
| 31 |
+
# We create a user with UID 1000 to match HF Spaces default and avoid root errors
|
| 32 |
+
RUN useradd -m -u 1000 hf_user
|
| 33 |
+
|
| 34 |
RUN mkdir -p /var/lib/postgresql/data && \
|
| 35 |
+
chown -R hf_user:hf_user /var/lib/postgresql/data && \
|
| 36 |
chmod 700 /var/lib/postgresql/data
|
| 37 |
|
| 38 |
+
# Switch to the non-root user
|
| 39 |
+
USER hf_user
|
| 40 |
+
|
| 41 |
+
# Expose the port for Postgres
|
| 42 |
EXPOSE 7860
|
| 43 |
|
| 44 |
# Set the entrypoint to our custom script
|