mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +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
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: registry.petermaquiran.xyz
|
registry: registry.petermaquiran.xyz
|
||||||
repo: registry.petermaquiran.xyz/tvone
|
repo: registry.petermaquiran.xyz/gabinete-web
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
dockerfile: Dockerfile
|
dockerfile: dockerfile
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
# 2. Trigger service update in Docker Swarm
|
# 2. Trigger service update in Docker Swarm
|
||||||
@@ -22,4 +22,4 @@ steps:
|
|||||||
curl -X POST https://docker-socket.petermaquiran.xyz/update-service
|
curl -X POST https://docker-socket.petermaquiran.xyz/update-service
|
||||||
-H "Authorization: Bearer 123"
|
-H "Authorization: Bearer 123"
|
||||||
-H "Content-Type: application/json"
|
-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\"}"
|
||||||
|
|||||||
+36
-17
@@ -1,26 +1,45 @@
|
|||||||
# ---------- Build Stage ----------
|
# =========================
|
||||||
FROM node:16-alpine AS build
|
# BUILD STAGE
|
||||||
|
# =========================
|
||||||
|
FROM node:16.20.2 AS build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install Ionic CLI (optional but safe)
|
# Avoid npm randomness
|
||||||
RUN npm install -g @ionic/cli@6 @angular/cli@12
|
ENV NPM_CONFIG_LEGACY_PEER_DEPS=true
|
||||||
|
ENV NPM_CONFIG_AUDIT=false
|
||||||
|
ENV NPM_CONFIG_FUND=false
|
||||||
|
|
||||||
COPY package*.json ./
|
# Copy dependency files first (better caching)
|
||||||
RUN npm install
|
COPY package*.json ./
|
||||||
|
|
||||||
COPY . .
|
# Clean install (IMPORTANT: single install only)
|
||||||
|
RUN npm cache clean --force
|
||||||
|
RUN npm install --legacy-peer-deps --no-audit --no-fund
|
||||||
|
|
||||||
# Build production app
|
# Copy full project
|
||||||
RUN ionic build --prod
|
COPY . .
|
||||||
|
|
||||||
# ---------- Run Stage ----------
|
# Build Ionic Angular app
|
||||||
FROM nginx:alpine
|
RUN npx ionic build --configuration production
|
||||||
|
|
||||||
# Copy build output to nginx
|
|
||||||
COPY --from=build /app/www /usr/share/nginx/html
|
|
||||||
|
|
||||||
# Expose port
|
# =========================
|
||||||
EXPOSE 80
|
# PRODUCTION STAGE (NGINX)
|
||||||
|
# =========================
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
# 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