From 79540a6830011c65f111086c7205542cc983e314 Mon Sep 17 00:00:00 2001 From: Aidan Date: Thu, 17 Apr 2025 15:16:27 -0400 Subject: [PATCH] docker: build fixes --- Dockerfile | 17 ++++++++--------- docker-compose.yml | 3 ++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e2ec49..91009d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM oven/bun:1 +FROM oven/bun:1 AS builder WORKDIR /app @@ -10,19 +10,18 @@ COPY . . ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 -# Build the application RUN bun run build -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs +# Final stage +FROM oven/bun:1 -# Public folder not used at the moment -# COPY --from=builder /app/public ./public +WORKDIR /app +COPY --from=builder /app /app + +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 ENV PORT=3000 -ENV HOSTNAME="0.0.0.0" - -USER nextjs EXPOSE 3000 diff --git a/docker-compose.yml b/docker-compose.yml index 220b97a..74121e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,4 +4,5 @@ services: ports: - 3000:3000 volumes: - - .:/app \ No newline at end of file + - .:/app + - /app/.next \ No newline at end of file