Aynkhn commited on
Commit ·
5874a8b
1
Parent(s): d6a24c7
Fix docker user uid conflict
Browse files- Dockerfile +5 -5
Dockerfile
CHANGED
|
@@ -28,16 +28,16 @@ WORKDIR /app
|
|
| 28 |
ENV NODE_ENV=production
|
| 29 |
ENV NEXT_TELEMETRY_DISABLED=1
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
|
| 34 |
COPY --from=builder /app/public ./public
|
| 35 |
|
| 36 |
# Automatically leverage output traces to reduce image size
|
| 37 |
-
COPY --from=builder --chown=
|
| 38 |
-
COPY --from=builder --chown=
|
| 39 |
|
| 40 |
-
USER
|
| 41 |
|
| 42 |
# Hugging Face routes traffic to port 7860
|
| 43 |
EXPOSE 7860
|
|
|
|
| 28 |
ENV NODE_ENV=production
|
| 29 |
ENV NEXT_TELEMETRY_DISABLED=1
|
| 30 |
|
| 31 |
+
# The node:alpine image already has a built-in 'node' user with uid 1000
|
| 32 |
+
# which is perfect for Hugging Face Spaces!
|
| 33 |
|
| 34 |
COPY --from=builder /app/public ./public
|
| 35 |
|
| 36 |
# Automatically leverage output traces to reduce image size
|
| 37 |
+
COPY --from=builder --chown=node:root /app/.next/standalone ./
|
| 38 |
+
COPY --from=builder --chown=node:root /app/.next/static ./.next/static
|
| 39 |
|
| 40 |
+
USER node
|
| 41 |
|
| 42 |
# Hugging Face routes traffic to port 7860
|
| 43 |
EXPOSE 7860
|