diff --git a/Dockerfile b/Dockerfile index a16f445..8949aad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18-alpine3.19 AS base +FROM node:20.18-alpine3.19 WORKDIR /app @@ -7,17 +7,17 @@ ENV NODE_ENV production RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs -COPY public ./app/public -COPY prisma ./app/prisma -COPY script.sh ./app/script.sh +COPY public /public +COPY prisma /prisma +COPY script.sh /script.sh # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing -COPY --chown=nextjs:nodejs .next/standalone ./app/ -COPY --chown=nextjs:nodejs .next/static ./app/.next/static +COPY --chown=nextjs:nodejs .next/standalone / +COPY --chown=nextjs:nodejs .next/static /.next/static -RUN chmod +x ./app/script.sh +RUN chmod +x script.sh #RUN mkdir .next -RUN chown nextjs:nodejs ./app/.next +RUN chown nextjs:nodejs .next USER nextjs diff --git a/script.sh b/script.sh index a0eae18..4ef7bd8 100644 --- a/script.sh +++ b/script.sh @@ -1,6 +1,5 @@ #!/bin/sh -cd /app npx prisma migrate deploy -HOSTNAME="0.0.0.0" node ./app/server.js +HOSTNAME="0.0.0.0" node server.js