-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Build and push Docker images | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v6.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Étape 1 : Construction de l'image de base | ||
FROM node:18 AS builder | ||
|
||
# Définir le répertoire de travail dans le conteneur | ||
WORKDIR /app | ||
|
||
# Copier les fichiers package.json et pnpm-lock.yaml | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Installer pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Installer les dépendances du projet | ||
RUN pnpm install | ||
|
||
# Copier le reste des fichiers du projet | ||
COPY . . | ||
|
||
# Construire le projet Next.js | ||
RUN pnpm build | ||
|
||
# Étape 2 : Création de l'image finale | ||
FROM node:18-alpine | ||
|
||
# Définir le répertoire de travail dans le conteneur | ||
WORKDIR /app | ||
|
||
# Copier les dépendances de production depuis l'étape de build | ||
COPY --from=builder /app/node_modules ./node_modules | ||
|
||
# Copier les fichiers de build du projet | ||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/package.json ./ | ||
|
||
# Copier les fichiers statiques du répertoire public | ||
COPY --from=builder /app/public ./public | ||
|
||
# Installer pnpm dans l'image finale | ||
RUN npm install -g pnpm | ||
|
||
# Exposer le port sur lequel l'application tourne | ||
EXPOSE 3000 | ||
|
||
# Commande pour démarrer l'application | ||
CMD ["pnpm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters