Skip to content

Commit

Permalink
ci: setup postbuild instead of handling it in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Sep 22, 2024
1 parent e6ca42f commit 943ec5a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd ${GITHUB_REPOSITORY##*/}
git pull
bun run build
cd docs
docker compose down
docker compose up -d
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ ENV SKIP_ENV_VALIDATION=true
RUN addgroup --system --gid 1002 nodejs && \
adduser --system --uid 1002 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next && chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "biome check --write",
"prebuild": "next telemetry disable",
"build": "next build",
"postbuild": "next-sitemap && mkdir -p .next/standalone/public .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",
Expand Down

0 comments on commit 943ec5a

Please sign in to comment.