🎨 docker file & dockercompose from tezosLink
This commit is contained in:
parent
ead8f43b7f
commit
ed60605af7
@ -4,6 +4,8 @@ FROM node:19-alpine AS deps
|
|||||||
WORKDIR tezosLink
|
WORKDIR tezosLink
|
||||||
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
|
COPY src/common/databases/schema.prisma ./src/common/databases/schema.prisma
|
||||||
|
RUN npx prisma generate
|
||||||
|
|
||||||
RUN npm install --frozen-lockfile
|
RUN npm install --frozen-lockfile
|
||||||
|
|
||||||
@ -14,6 +16,7 @@ WORKDIR tezosLink
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=deps tezosLink/node_modules ./node_modules
|
COPY --from=deps tezosLink/node_modules ./node_modules
|
||||||
|
RUN npx prisma generate
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
@ -24,10 +27,13 @@ WORKDIR tezosLink
|
|||||||
RUN adduser -D tezoslinkuser --uid 10000 && chown -R tezoslinkuser .
|
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/node_modules ./node_modules
|
||||||
COPY --from=builder --chown=tezoslinkuser tezosLink/dist/api ./src/api
|
COPY --from=builder --chown=tezoslinkuser tezosLink/dist/api ./dist/api
|
||||||
|
COPY --from=builder --chown=tezoslinkuser tezosLink/dist/entries ./dist/entries
|
||||||
|
COPY --from=builder --chown=tezoslinkuser tezosLink/dist/common ./dist/common
|
||||||
|
#COPY --from=builder --chown=tezoslinkuser tezosLink/src/common/databases/ ./src/common/databases/
|
||||||
COPY --from=builder --chown=tezoslinkuser tezosLink/package.json ./package.json
|
COPY --from=builder --chown=tezoslinkuser tezosLink/package.json ./package.json
|
||||||
|
|
||||||
USER tezoslinkuser
|
USER tezoslinkuser
|
||||||
|
|
||||||
CMD ["npm", "run api:start"]
|
CMD ["npm", "run", "api:start"]
|
||||||
|
EXPOSE 3001
|
@ -1,36 +0,0 @@
|
|||||||
# Install dependencies only when needed
|
|
||||||
FROM node:19-alpine AS deps
|
|
||||||
|
|
||||||
WORKDIR LEcoffre
|
|
||||||
|
|
||||||
COPY package.json ./
|
|
||||||
|
|
||||||
RUN npm install --frozen-lockfile
|
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
|
||||||
FROM node:19-alpine AS builder
|
|
||||||
|
|
||||||
WORKDIR LEcoffre
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
COPY --from=deps LEcoffre/node_modules ./node_modules
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
|
||||||
FROM node:19-alpine AS production
|
|
||||||
|
|
||||||
WORKDIR LEcoffre
|
|
||||||
|
|
||||||
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
|
|
||||||
|
|
||||||
COPY --from=builder --chown=lecoffreuser LEcoffre/node_modules ./node_modules
|
|
||||||
COPY --from=builder --chown=lecoffreuser LEcoffre/public ./public
|
|
||||||
COPY --from=builder --chown=lecoffreuser LEcoffre/dist/front ./src/front
|
|
||||||
COPY --from=builder --chown=lecoffreuser LEcoffre/.next ./.next
|
|
||||||
|
|
||||||
COPY --from=builder --chown=lecoffreuser LEcoffre/package.json ./package.json
|
|
||||||
#COPY --from=builder --chown=lecoffreuser src/front/next.config.js ./next.config.js
|
|
||||||
|
|
||||||
USER lecoffreuser
|
|
||||||
|
|
||||||
CMD ["npm", "run web:start"]
|
|
10
Dockerfiles/Dockerfile.full
Normal file
10
Dockerfiles/Dockerfile.full
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Install dependencies only when needed
|
||||||
|
FROM node:19-alpine AS deps
|
||||||
|
|
||||||
|
WORKDIR tezosLink
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN npm i
|
||||||
|
RUN npm run build
|
||||||
|
CMD ["npm", "run", "web:start"]
|
||||||
|
EXPOSE 3000
|
@ -1,33 +0,0 @@
|
|||||||
# 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/dist/rpc-gateway ./src/rpc-gateway
|
|
||||||
|
|
||||||
COPY --from=builder --chown=tezoslinkuser tezosLink/package.json ./package.json
|
|
||||||
|
|
||||||
USER tezoslinkuser
|
|
||||||
|
|
||||||
CMD ["npm", "run rpc-gateway:start"]
|
|
Loading…
x
Reference in New Issue
Block a user