From 5362f81ac22eab12e3e817595dcd53b57201b9c2 Mon Sep 17 00:00:00 2001 From: "Julien Richard [RMT - JS] Wild Code School" <33219171+jujuck@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:45:26 +0100 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 899733e..4583868 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,33 @@ -# Dockerfile backend -FROM node:16.14 +#syntax=docker/dockerfile:1.4 +FROM node:20-alpine + +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +# hadolint ignore=DL3018 +RUN apk add --no-cache libc6-compat WORKDIR /usr/src/app -COPY ./ . +RUN corepack enable && \ + corepack prepare --activate pnpm@latest && \ + pnpm config -g set store-dir /.pnpm-store + +COPY --link ./frontend/package.json ./frontend/package.json +COPY --link ./backend/package.json ./backend/package.json + +RUN cd frontend && \ + pnpm fetch && \ + pnpm install +RUN cd backend && \ + pnpm fetch && \ + pnpm install + +COPY ./frontend ./frontend + +RUN cd frontend && \ + pnpm run build + +COPY ./backend ./backend +COPY docker-entry.sh . +COPY package.json . -RUN npm install +CMD ["sh","./docker-entry.sh"] From 87e7bd30433b47dcf93c737ba6361b0c7231aea0 Mon Sep 17 00:00:00 2001 From: "Julien Richard [RMT - JS] Wild Code School" <33219171+jujuck@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:46:00 +0100 Subject: [PATCH 2/2] Update docker-compose.prod.yml --- docker-compose.prod.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index c42585e..72bb5d3 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -4,10 +4,6 @@ services: web: build: . container_name: ${PROJECT_NAME:-project}-web - volumes: - - .:/var/www - - ./docker-entry.sh:/etc/entrypoint.sh - entrypoint: [ "sh", "/etc/entrypoint.sh" ] env_file: - ../envs/.env-${GITHUB_REPOSITORY_NAME} environment: