Change building and deploying procedure
This commit is contained in:
parent
33e90e37b3
commit
81673a3fcc
23
Dockerfile
23
Dockerfile
@ -11,23 +11,8 @@ COPY . .
|
|||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM node:alpine AS runner
|
FROM nginx AS runner
|
||||||
WORKDIR /app
|
COPY --from=builder /app/out /usr/share/nginx/html
|
||||||
|
|
||||||
ENV NODE_ENV production
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
COPY --from=builder /app/public ./public
|
|
||||||
COPY --from=builder /app/.next ./.next
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
|
||||||
COPY --from=builder /app/package.json ./package.json
|
|
||||||
|
|
||||||
RUN addgroup -g 1001 -S nodejs
|
|
||||||
RUN adduser -S nextjs -u 1001
|
|
||||||
RUN chown -R nextjs:nodejs /app/.next
|
|
||||||
USER nextjs
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
RUN npx next telemetry disable
|
|
||||||
|
|
||||||
CMD ["yarn", "start"]
|
|
||||||
|
@ -2,8 +2,12 @@ version: "3.2"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
website:
|
website:
|
||||||
build: .
|
build:
|
||||||
container_name: therbron.com
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: "therbron.com"
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 8000:80
|
||||||
|
volumes:
|
||||||
|
- ./out:/usr/share/nginx/html
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
Loading…
Reference in New Issue
Block a user