Skip to content

Commit

Permalink
fix: build run by copying static files correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Sep 22, 2024
1 parent fd476fe commit bbf76e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.
# The ARGS in docker-compose.yml and the Dockerfile must also be updated.
# Also update any GitHub Actions that use these variables.

# General
NEXT_TELEMETRY_DISABLED="true"
NODE_ENV="development"
NEXT_TELEMETRY_DISABLED="true"
NEXT_PUBLIC_SITE_URL="http://localhost:3000"

# Database
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV NEXT_TELEMETRY_DISABLED=true
ENV SKIP_ENV_VALIDATION=true

# Set environment variables during the build
Expand Down Expand Up @@ -65,7 +65,7 @@ FROM base AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV NEXT_TELEMETRY_DISABLED=true
ENV SKIP_ENV_VALIDATION=true

RUN addgroup --system --gid 1002 nodejs && \
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"type": "module",
"scripts": {
"prepare": "if [ \"$NODE_ENV\" != \"production\" ]; then lefthook install; fi",
"postbuild": "next-sitemap",
"prebuild": "next telemetry disable",
"build": "next build",
"dev": "next dev --turbo",
"lint": "biome check --write",
"start": "next start",
"prebuild": "next telemetry disable",
"build": "next build",
"postbuild": "next-sitemap && mkdir -p .next/standalone/public && mkdir -p .next/standalone/.next/static && cp -R public/* .next/standalone/public/ && cp -R .next/static/* .next/standalone/.next/static/",
"start": "bun run .next/standalone/server.js",
"db:start": "docker-compose up db",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
Expand Down

0 comments on commit bbf76e3

Please sign in to comment.