mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Compare commits
6 Commits
fe2f74e2fa
...
developer
| Author | SHA1 | Date | |
|---|---|---|---|
| 444e2e0cd3 | |||
| cd902a0daa | |||
| 504fda9c38 | |||
| 40d852c6c1 | |||
| fd7e4a52a8 | |||
| 9010f8789c |
+3
-3
@@ -8,10 +8,10 @@ steps:
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: registry.petermaquiran.xyz
|
||||
repo: registry.petermaquiran.xyz/tvone
|
||||
repo: registry.petermaquiran.xyz/gabinete-web
|
||||
tags:
|
||||
- latest
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: dockerfile
|
||||
context: .
|
||||
|
||||
# 2. Trigger service update in Docker Swarm
|
||||
@@ -22,4 +22,4 @@ steps:
|
||||
curl -X POST https://docker-socket.petermaquiran.xyz/update-service
|
||||
-H "Authorization: Bearer 123"
|
||||
-H "Content-Type: application/json"
|
||||
-d "{\"service\":\"tvone_tvone\",\"image\":\"registry.petermaquiran.xyz/tvone:latest\"}"
|
||||
-d "{\"service\":\"gabinete_gabinete-web\",\"image\":\"registry.petermaquiran.xyz/gabinete-web:latest\"}"
|
||||
|
||||
+44
-25
@@ -1,26 +1,45 @@
|
||||
# ---------- Build Stage ----------
|
||||
FROM node:16-alpine AS build
|
||||
# =========================
|
||||
# BUILD STAGE
|
||||
# =========================
|
||||
FROM node:16.20.2 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Ionic CLI (optional but safe)
|
||||
RUN npm install -g @ionic/cli@6 @angular/cli@12
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
# Build production app
|
||||
RUN ionic build --prod
|
||||
|
||||
# ---------- Run Stage ----------
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy build output to nginx
|
||||
COPY --from=build /app/www /usr/share/nginx/html
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
WORKDIR /app
|
||||
|
||||
# Avoid npm randomness
|
||||
ENV NPM_CONFIG_LEGACY_PEER_DEPS=true
|
||||
ENV NPM_CONFIG_AUDIT=false
|
||||
ENV NPM_CONFIG_FUND=false
|
||||
|
||||
# Copy dependency files first (better caching)
|
||||
COPY package*.json ./
|
||||
|
||||
# Clean install (IMPORTANT: single install only)
|
||||
RUN npm cache clean --force
|
||||
RUN npm install --legacy-peer-deps --no-audit --no-fund
|
||||
|
||||
# Copy full project
|
||||
COPY . .
|
||||
|
||||
# Build Ionic Angular app
|
||||
RUN npx ionic build --configuration production
|
||||
|
||||
|
||||
# =========================
|
||||
# PRODUCTION STAGE (NGINX)
|
||||
# =========================
|
||||
FROM nginx:alpine
|
||||
|
||||
# Nginx config (optional but recommended for SPA routing)
|
||||
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Clean default nginx files
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copy build output from previous stage
|
||||
COPY --from=build /app/www /usr/share/nginx/html
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user