Minor Update
Some checks failed
Build and Push to Registry / build-and-push (push) Failing after 23s
Some checks failed
Build and Push to Registry / build-and-push (push) Failing after 23s
This commit is contained in:
parent
fd4a9d32b7
commit
e8d7c5777f
4
.github/workflows/cicd.yml
vendored
4
.github/workflows/cicd.yml
vendored
@ -26,6 +26,8 @@ jobs:
|
|||||||
password: ${{ secrets.TOKEN }}
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
|
env:
|
||||||
|
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@ -35,4 +37,4 @@ jobs:
|
|||||||
ENV_VARS=${{ secrets.ENV_VARS }}
|
ENV_VARS=${{ secrets.ENV_VARS }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|
24
Dockerfile
24
Dockerfile
@ -1,7 +1,7 @@
|
|||||||
# Install dependencies only when needed
|
# Install dependencies only when needed
|
||||||
FROM node:19-alpine AS deps
|
FROM node:19-alpine AS deps
|
||||||
|
|
||||||
WORKDIR leCoffre-front
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ RUN apk update && apk add openssh-client git
|
|||||||
|
|
||||||
ARG SSH_PRIVATE_KEY
|
ARG SSH_PRIVATE_KEY
|
||||||
RUN mkdir -p /root/.ssh && \
|
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 && \
|
chmod 600 /root/.ssh/id_rsa && \
|
||||||
eval "$(ssh-agent -s)" && \
|
eval "$(ssh-agent -s)" && \
|
||||||
ssh-add /root/.ssh/id_rsa && \
|
ssh-add /root/.ssh/id_rsa && \
|
||||||
@ -23,11 +23,11 @@ RUN npm install --frozen-lockfile
|
|||||||
# Rebuild the source code only when needed
|
# Rebuild the source code only when needed
|
||||||
FROM node:19-alpine AS builder
|
FROM node:19-alpine AS builder
|
||||||
|
|
||||||
WORKDIR leCoffre-front
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=deps leCoffre-front/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps leCoffre-front/package.json package.json
|
COPY --from=deps /app/package.json package.json
|
||||||
COPY --from=deps leCoffre-front/.env ./.env
|
COPY --from=deps /app/.env ./.env
|
||||||
COPY tsconfig.json tsconfig.json
|
COPY tsconfig.json tsconfig.json
|
||||||
COPY next.config.js next.config.js
|
COPY next.config.js next.config.js
|
||||||
COPY src src
|
COPY src src
|
||||||
@ -37,16 +37,16 @@ RUN npm run build
|
|||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM node:19-alpine AS production
|
FROM node:19-alpine AS production
|
||||||
|
|
||||||
WORKDIR leCoffre-front
|
WORKDIR /app
|
||||||
|
|
||||||
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
|
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
|
||||||
|
|
||||||
COPY public ./public
|
COPY public ./public
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre-front/node_modules ./node_modules
|
COPY --from=builder --chown=lecoffreuser /app/node_modules ./node_modules
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre-front/.next ./.next
|
COPY --from=builder --chown=lecoffreuser /app/.next ./.next
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre-front/next.config.js ./next.config.js
|
COPY --from=builder --chown=lecoffreuser /app/next.config.js ./next.config.js
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre-front/package.json ./package.json
|
COPY --from=builder --chown=lecoffreuser /app/package.json ./package.json
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre-front/.env ./.env
|
COPY --from=builder --chown=lecoffreuser /app/.env ./.env
|
||||||
|
|
||||||
USER lecoffreuser
|
USER lecoffreuser
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user