config docker pre mod

This commit is contained in:
2025-11-26 11:08:36 -03:00
parent 75989b0546
commit e1bd6fa61a
3 changed files with 7 additions and 12 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
node_modules

2
.gitignore vendored
View File

@@ -49,3 +49,5 @@ coverage
tmp
temp
.eslintcache
out

View File

@@ -8,18 +8,10 @@ WORKDIR /usr/src/app
RUN addgroup --system --gid 1001 sveltekit
RUN adduser --system --uid 1001 sveltekit
# Copy package.json and bun.lock (if available)
COPY package.json bun.lock* ./
# Copy workspace packages first (needed for bun install to resolve local dependencies)
# Copy package.json files to establish workspace structure
COPY packages/backend/package.json ./packages/backend/
COPY packages/eslint-config/package.json ./packages/eslint-config/
# Copy eslint-config files (needed for the package to be valid)
COPY packages/eslint-config/*.js ./packages/eslint-config/
# Copy apps/web package.json (also part of the workspace)
COPY apps/web/package.json ./apps/web/
# Install dependencies (including dev dependencies for build)
# This will resolve workspace dependencies using the package.json files we just copied
RUN bun install --frozen-lockfile
@@ -44,13 +36,13 @@ RUN addgroup --system --gid 1001 sveltekit
RUN adduser --system --uid 1001 sveltekit
# Copy built application from base stage
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/apps/web/build ./build
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/apps/web/package.json ./package.json
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/build ./build
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/package.json ./package.json
# Copy node_modules from root (Bun manages workspaces centrally)
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/node_modules ./node_modules
# Copy any additional files needed for runtime
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/apps/web/static ./static
COPY --from=base --chown=sveltekit:sveltekit /usr/src/app/static ./static
# Switch to non-root user
USER sveltekit