mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
Fix ownership of directories
This commit is contained in:
@@ -6,7 +6,7 @@ WORKDIR /app
|
|||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
# Copy package.json and lockfile to leverage caching
|
# Copy package.json and lockfile to leverage caching
|
||||||
COPY frontend/package.json frontend/pnpm-lock.yaml ./
|
COPY frontend/package.json frontend/pnpm-lock.yaml ./
|
||||||
RUN pnpm install --frozen-lockfile --shamefully-hoist
|
RUN pnpm install --frozen-lockfile --shamefully-hoist
|
||||||
|
|
||||||
# Build Nuxt (frontend) stage
|
# Build Nuxt (frontend) stage
|
||||||
@@ -17,7 +17,7 @@ WORKDIR /app
|
|||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
# Copy over source files and node_modules from dependencies stage
|
# Copy over source files and node_modules from dependencies stage
|
||||||
COPY frontend .
|
COPY frontend .
|
||||||
COPY --from=frontend-dependencies /app/node_modules ./node_modules
|
COPY --from=frontend-dependencies /app/node_modules ./node_modules
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ FROM public.ecr.aws/docker/library/golang:alpine AS builder-dependencies
|
|||||||
WORKDIR /go/src/app
|
WORKDIR /go/src/app
|
||||||
|
|
||||||
# Copy go.mod and go.sum for better caching
|
# Copy go.mod and go.sum for better caching
|
||||||
COPY ./backend/go.mod ./backend/go.sum ./
|
COPY ./backend/go.mod ./backend/go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
# Build API stage
|
# Build API stage
|
||||||
@@ -87,10 +87,7 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|||||||
# Persist volume
|
# Persist volume
|
||||||
VOLUME [ "/data" ]
|
VOLUME [ "/data" ]
|
||||||
|
|
||||||
# Set ownership for required directories
|
# Set ownership for required directories at runtime (excluding /data)
|
||||||
RUN chown -R nonroot:nonroot /app /data /app/api
|
ENTRYPOINT ["/bin/sh", "-c", "chown -R nonroot:nonroot /app /app/api && /app/api /data/config.yml"]
|
||||||
|
|
||||||
# Entrypoint and CMD
|
|
||||||
USER nonroot
|
USER nonroot
|
||||||
ENTRYPOINT [ "/app/api" ]
|
CMD ["/data/config.yml"]
|
||||||
CMD [ "/data/config.yml" ]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user