From 51d9fb0628650c983c11692718c77d9b5ca704f3 Mon Sep 17 00:00:00 2001 From: Dylan Decrulle <81740200+ddecrulle@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:25:01 +0100 Subject: [PATCH] build: do not build in dockerfile --- .github/workflows/pull-request.yaml | 1 - Dockerfile | 18 +++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index dce22ac..329b8a4 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -43,7 +43,6 @@ jobs: with: name: dist path: dist - - run: tar -cvf build.tar ./dist - name: Computing Docker image tags id: step1 env: diff --git a/Dockerfile b/Dockerfile index 2c802d7..2a6ddb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,15 @@ -# Build environment -FROM node:20-alpine AS build -WORKDIR /app -COPY package.json yarn.lock .env ./ -COPY public ./public -COPY index.html ./ -RUN yarn install --frozen-lockfile --network-timeout 600000 -COPY tsconfig.json .prettierrc vite.config.js ./ -COPY scripts ./scripts -COPY src ./src -RUN yarn build -COPY nginx.conf ./ # Production Env FROM nginx:stable-alpine -COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf +COPY nginx.conf /etc/nginx/conf.d/default.conf WORKDIR /usr/share/nginx/html # Add bash RUN apk add --no-cache bash ## Copy .env file and shell script to container -COPY --from=build /app/dist ./ -COPY --from=build /app/entrypoint.sh / +ADD dist /usr/share/nginx/html +COPY entrypoint.sh / ## Make shell script executable and prevent windows encoding RUN sed -i -e 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh