refactor(docker): mise à jour du Dockerfile pour utiliser hugomods/hugo et suppression de docker-compose
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -1,22 +1,25 @@
|
||||
FROM node:20-alpine AS build
|
||||
FROM hugomods/hugo:latest
|
||||
|
||||
# Dépendances système utiles (optionnel)
|
||||
RUN apk add --no-cache git
|
||||
# Installe Node.js et npm
|
||||
USER root
|
||||
RUN apk add --no-cache nodejs npm git
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /src
|
||||
|
||||
# Copie package.json et package-lock.json si présent
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
|
||||
# Installation des dépendances
|
||||
RUN npm install
|
||||
|
||||
# Copie du reste du code
|
||||
# Installation des dépendances
|
||||
RUN npm install --save-dev sass
|
||||
|
||||
# Build CSS (tailwind + scss)
|
||||
RUN npm run build
|
||||
|
||||
# Copie le reste du code
|
||||
COPY . .
|
||||
|
||||
# Expose le port utilisé par hugo server
|
||||
EXPOSE 1313
|
||||
|
||||
# Commande de démarrage
|
||||
CMD ["npm", "run", "start"]
|
||||
CMD ["hugo", "server", "-D", "--bind", "0.0.0.0", "--baseURL", "http://localhost:1313", "--appendPort=false"]
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
front:
|
||||
image: hugomods/hugo:latest
|
||||
ports:
|
||||
- "127.0.0.1:1313:1313"
|
||||
volumes:
|
||||
- ".:/src"
|
||||
command: >
|
||||
npm run dev
|
||||
Reference in New Issue
Block a user