Minor Update
Some checks failed
Build and Push to Registry / build-and-push (push) Failing after 23s

This commit is contained in:
omaroughriss 2025-07-01 16:19:17 +02:00
parent fd4a9d32b7
commit e8d7c5777f
2 changed files with 15 additions and 13 deletions

View File

@ -26,6 +26,8 @@ jobs:
password: ${{ secrets.TOKEN }}
- name: Build and push
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
uses: docker/build-push-action@v5
with:
context: .

View File

@ -1,7 +1,7 @@
# Install dependencies only when needed
FROM node:19-alpine AS deps
WORKDIR leCoffre-front
WORKDIR /app
COPY package.json ./
@ -12,7 +12,7 @@ RUN apk update && apk add openssh-client git
ARG SSH_PRIVATE_KEY
RUN mkdir -p /root/.ssh && \
echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && \
echo "${SSH_PRIVATE_KEY}" | base64 -d > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa && \
eval "$(ssh-agent -s)" && \
ssh-add /root/.ssh/id_rsa && \
@ -23,11 +23,11 @@ RUN npm install --frozen-lockfile
# Rebuild the source code only when needed
FROM node:19-alpine AS builder
WORKDIR leCoffre-front
WORKDIR /app
COPY --from=deps leCoffre-front/node_modules ./node_modules
COPY --from=deps leCoffre-front/package.json package.json
COPY --from=deps leCoffre-front/.env ./.env
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package.json package.json
COPY --from=deps /app/.env ./.env
COPY tsconfig.json tsconfig.json
COPY next.config.js next.config.js
COPY src src
@ -37,16 +37,16 @@ RUN npm run build
# Production image, copy all the files and run next
FROM node:19-alpine AS production
WORKDIR leCoffre-front
WORKDIR /app
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
COPY public ./public
COPY --from=builder --chown=lecoffreuser leCoffre-front/node_modules ./node_modules
COPY --from=builder --chown=lecoffreuser leCoffre-front/.next ./.next
COPY --from=builder --chown=lecoffreuser leCoffre-front/next.config.js ./next.config.js
COPY --from=builder --chown=lecoffreuser leCoffre-front/package.json ./package.json
COPY --from=builder --chown=lecoffreuser leCoffre-front/.env ./.env
COPY --from=builder --chown=lecoffreuser /app/node_modules ./node_modules
COPY --from=builder --chown=lecoffreuser /app/.next ./.next
COPY --from=builder --chown=lecoffreuser /app/next.config.js ./next.config.js
COPY --from=builder --chown=lecoffreuser /app/package.json ./package.json
COPY --from=builder --chown=lecoffreuser /app/.env ./.env
USER lecoffreuser