Almost hostable from monorepo
This commit is contained in:
@@ -21,7 +21,8 @@
|
||||
"plugins": [{ "name": "next" }],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
"@/*": ["./src/*"],
|
||||
"~/*": ["../../packages/backend/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
|
@@ -10,6 +10,8 @@ WORKDIR /app
|
||||
|
||||
# Copy package + whichever Bun lock file you have (optional)
|
||||
COPY package.json bun.lockb* bun.lock* ./
|
||||
COPY tsconfig.base.json ./
|
||||
COPY apps/next/package.json ./apps/next/
|
||||
|
||||
# If bun.lockb exists, enforce frozen; otherwise install and generate it
|
||||
RUN if [ -f bun.lockb ]; then \
|
||||
@@ -22,7 +24,10 @@ RUN if [ -f bun.lockb ]; then \
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
COPY --from=deps /app/tsconfig.base.json ./tsconfig.base.json
|
||||
COPY apps/next ./apps/next
|
||||
COPY packages ./packages
|
||||
WORKDIR /app/apps/next
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN bun run build
|
||||
|
||||
@@ -34,13 +39,12 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# non-root user
|
||||
RUN addgroup -S nodejs -g 1001 && adduser -S nextjs -u 1001
|
||||
COPY --from=builder /app/public ./public
|
||||
RUN mkdir .next && chown -R nextjs:nodejs .next
|
||||
COPY --from=builder /app/apps/next/public ./public
|
||||
RUN mkdir -p .next/cache && chown -R nextjs:nodejs .next
|
||||
|
||||
# Next standalone output
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/apps/next/.next/standalone ./
|
||||
COPY --from=builder /app/apps/next/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
|
@@ -4,8 +4,8 @@ networks:
|
||||
services:
|
||||
techtracker-next:
|
||||
build:
|
||||
context: ../../../apps/next/
|
||||
dockerfile: host/next/docker/Dockerfile
|
||||
context: ../../../
|
||||
dockerfile: ./host/next/docker/Dockerfile
|
||||
image: ${CONTAINER_NAME}:alpine
|
||||
container_name: ${CONTAINER_NAME}
|
||||
env_file: [.env]
|
||||
|
Reference in New Issue
Block a user