Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -2
Dockerfile
CHANGED
|
@@ -29,14 +29,18 @@ COPY . .
|
|
| 29 |
# Ensure the /app directory (and its subdirectories) are writable
|
| 30 |
RUN chmod -R 777 /app
|
| 31 |
|
|
|
|
|
|
|
| 32 |
# Remove any stale Hugo build lock file
|
| 33 |
RUN rm -f /app/.hugo_build.lock
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
# (Optional) If you use Hugo Modules, refresh them:
|
| 36 |
RUN hugo --ignoreCache && hugo mod clean && hugo mod get
|
| 37 |
|
| 38 |
-
RUN chmod u+w /app/.hugo_build.lock
|
| 39 |
-
|
| 40 |
# Build the Hugo site with --noTimes to avoid file time updates
|
| 41 |
RUN rm -f /app/.hugo_build.lock && hugo --noTimes
|
| 42 |
|
|
|
|
| 29 |
# Ensure the /app directory (and its subdirectories) are writable
|
| 30 |
RUN chmod -R 777 /app
|
| 31 |
|
| 32 |
+
RUN chmod u+w /app/.hugo_build.lock
|
| 33 |
+
|
| 34 |
# Remove any stale Hugo build lock file
|
| 35 |
RUN rm -f /app/.hugo_build.lock
|
| 36 |
|
| 37 |
+
WORKDIR /app
|
| 38 |
+
RUN mkdir -p /app && chown -R hugo:hugo /app
|
| 39 |
+
USER hugo
|
| 40 |
+
|
| 41 |
# (Optional) If you use Hugo Modules, refresh them:
|
| 42 |
RUN hugo --ignoreCache && hugo mod clean && hugo mod get
|
| 43 |
|
|
|
|
|
|
|
| 44 |
# Build the Hugo site with --noTimes to avoid file time updates
|
| 45 |
RUN rm -f /app/.hugo_build.lock && hugo --noTimes
|
| 46 |
|