lecoffre-front/Dockerfile
omaroughriss 0492b3e28d
All checks were successful
Build and Push to Registry / build-and-push (push) Successful in 3m54s
Delete copy command
2025-07-23 16:00:31 +02:00

29 lines
773 B
Docker

# syntax=docker/dockerfile:1.4
FROM node:19-alpine AS deps
WORKDIR /leCoffre-front
COPY package.json ./
RUN apk update && apk add --no-cache openssh-client git
# Forward SSH agent via BuildKit (clé jamais écrite dans l'image)
RUN --mount=type=ssh \
mkdir -p /root/.ssh && \
ssh-keyscan git.4nkweb.com >> /root/.ssh/known_hosts && \
npm install --frozen-lockfile
# Configuration pour le développement
FROM node:19-alpine AS development
WORKDIR /leCoffre-front
COPY --from=deps /leCoffre-front/node_modules ./node_modules
COPY --from=deps /leCoffre-front/package.json ./package.json
COPY . .
# Création de l'utilisateur non-root
RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
USER lecoffreuser
CMD ["npm", "run", "dev"]
EXPOSE 3000