fix: lancement de la commande npm run build, source directe pour l'image du runner
This commit is contained in:
@@ -23,13 +23,15 @@ RUN npm run build
|
||||
# ==================
|
||||
|
||||
|
||||
FROM dhi.io/nginx:1.28.0-alpine3.21-dev AS runner
|
||||
FROM nginx:1.28.0-alpine3.21 AS runner
|
||||
|
||||
# Copie de la configuration de nginx
|
||||
COPY --chown=root:root --chmod=755 nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --chown=root:root nginx.conf /etc/nginx/nginx.conf
|
||||
RUN chmod 755 /etc/nginx/nginx.conf
|
||||
|
||||
# Copy the static build output from the build stage to Nginx's default HTML serving directory
|
||||
COPY --chown=root:root --chmod=755 --from=builder /app/dist/*/browser /usr/share/nginx/html
|
||||
COPY --chown=root:root --from=builder /app/dist/*/browser /usr/share/nginx/html
|
||||
RUN chmod 755 /usr/share/nginx/html
|
||||
|
||||
# Create necessary directories with proper permissions for nginx
|
||||
RUN mkdir -p /var/log/nginx /var/cache/nginx && \
|
||||
@@ -39,7 +41,6 @@ RUN mkdir -p /var/log/nginx /var/cache/nginx && \
|
||||
USER nginx
|
||||
|
||||
# Frontend : port 3000
|
||||
# Backend : port 8000
|
||||
EXPOSE 3000
|
||||
|
||||
# Start Nginx directly with custom config
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"build": "node node_modules/@angular/cli/bin/ng.js build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test",
|
||||
"test:ci": "ng test --watch=false"
|
||||
"test:ci": "ng test --watch=false"
|
||||
},
|
||||
"private": true,
|
||||
"packageManager": "npm@11.19.0",
|
||||
|
||||
@@ -28,7 +28,7 @@ resource "null_resource" "build_frontend" {
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "cd ${local.frontend_dir} && npm ci && npm run build"
|
||||
command = "cd ${local.frontend_dir} && npm ci && chmod -R +x node_modules/@angular/cli/bin && chmod -R +x node_modules/.bin && npm exec ng build"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,4 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
backend "local" {
|
||||
path = "terraform.tfstate"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user