diff --git a/Dockerfiles/Dockerfile.api b/Dockerfiles/Dockerfile.api index aba77b57..6977373a 100644 --- a/Dockerfiles/Dockerfile.api +++ b/Dockerfiles/Dockerfile.api @@ -4,6 +4,8 @@ FROM node:19-alpine AS deps WORKDIR tezosLink COPY package.json ./ +COPY src/common/databases/schema.prisma ./src/common/databases/schema.prisma +RUN npx prisma generate RUN npm install --frozen-lockfile @@ -14,6 +16,7 @@ WORKDIR tezosLink COPY . . COPY --from=deps tezosLink/node_modules ./node_modules +RUN npx prisma generate RUN npm run build # Production image, copy all the files and run next @@ -24,10 +27,13 @@ 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/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 USER tezoslinkuser -CMD ["npm", "run api:start"] \ No newline at end of file +CMD ["npm", "run", "api:start"] +EXPOSE 3001 \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.front b/Dockerfiles/Dockerfile.front deleted file mode 100644 index 2b30fddc..00000000 --- a/Dockerfiles/Dockerfile.front +++ /dev/null @@ -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"] \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.full b/Dockerfiles/Dockerfile.full new file mode 100644 index 00000000..77865e96 --- /dev/null +++ b/Dockerfiles/Dockerfile.full @@ -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 \ No newline at end of file diff --git a/Dockerfiles/Dockerfile.proxy b/Dockerfiles/Dockerfile.proxy deleted file mode 100644 index a2c827c1..00000000 --- a/Dockerfiles/Dockerfile.proxy +++ /dev/null @@ -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"] \ No newline at end of file