36 lines
1003 B
Docker
36 lines
1003 B
Docker
# Install dependencies only when needed
|
|
FROM node:19-alpine AS deps
|
|
|
|
WORKDIR tezosLink
|
|
|
|
COPY package.json ./
|
|
|
|
RUN npm install --frozen-lockfile
|
|
|
|
# Rebuild the source code only when needed
|
|
FROM node:19-alpine AS builder
|
|
|
|
WORKDIR tezosLink
|
|
|
|
COPY . .
|
|
COPY --from=deps tezosLink/node_modules ./node_modules
|
|
RUN npm run build
|
|
|
|
# Production image, copy all the files and run next
|
|
FROM node:19-alpine AS production
|
|
|
|
WORKDIR tezosLink
|
|
|
|
RUN adduser -D tezoslinkuser --uid 10000 && chown -R tezoslinkuser .
|
|
|
|
COPY --from=builder --chown=tezoslinkuser tezosLink/node_modules ./node_modules
|
|
COPY --from=builder --chown=tezoslinkuser tezosLink/public ./public
|
|
COPY --from=builder --chown=tezoslinkuser tezosLink/dist/front ./src/front
|
|
COPY --from=builder --chown=tezoslinkuser tezosLink/.next ./.next
|
|
|
|
COPY --from=builder --chown=tezoslinkuser tezosLink/package.json ./package.json
|
|
#COPY --from=builder --chown=tezoslinkuser src/front/next.config.js ./next.config.js
|
|
|
|
USER tezoslinkuser
|
|
|
|
CMD ["npm", "run web:start"] |