
Heric Camargo pushed to branch main at Root / CLI / Mirror Monitor Commits: 659ddef1 by Heric Camargo at 2025-08-12T09:55:36-03:00 build: switch base image from debian to alpine - - - - - 2e607e21 by Heric Camargo at 2025-08-12T09:55:44-03:00 fix: update container port to 80 in deployment, service, and ingress configurations - - - - - 4 changed files: - Containerfile - deploy/k8s/deployment.yaml - deploy/k8s/ingress.yaml - deploy/k8s/service.yaml Changes: ===================================== Containerfile ===================================== @@ -15,14 +15,13 @@ COPY . . # Compilando o binário da API RUN go build -o mirror-monitor ./cmd/api + # Etapa final: -FROM debian:bookworm-slim +FROM alpine:latest # Instalando o rsync e criando usuário não-root: -RUN apt-get update && \ - apt-get install -y rsync ca-certificates && \ - apt-get clean && rm -rf /var/lib/apt/lists/* && \ - useradd -r -u 1000 -s /bin/false appuser +RUN apk add --no-cache rsync ca-certificates && \ + adduser -D -u 1000 -s /sbin/nologin appuser # Copiando o binário compilado: COPY --from=builder /app/mirror-monitor /usr/local/bin/mirror-monitor @@ -33,9 +32,5 @@ RUN chmod +x /usr/local/bin/mirror-monitor # Mudando para usuário não-root USER 1000 -# Exponha a porta, se necessário: -#Atenção: se você mudar de porta, esse trecho do código deve-se mudar também! -EXPOSE 8080 - # Definindo o comando de entrada: CMD ["mirror-monitor"] ===================================== deploy/k8s/deployment.yaml ===================================== @@ -24,14 +24,14 @@ spec: image: mirror-monitor-api:latest imagePullPolicy: IfNotPresent ports: - - containerPort: 8080 + - containerPort: 80 env: - name: RSYNC_URL value: "rsync://sagres.c3sl.ufpr.br/" - name: POLLING_INTERVAL_SECONDS value: "300" - name: PORT - value: "8080" + value: "80" resources: requests: memory: "64Mi" @@ -42,7 +42,7 @@ spec: livenessProbe: httpGet: path: /modules - port: 8080 + port: 80 initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 5 @@ -50,7 +50,7 @@ spec: readinessProbe: httpGet: path: /modules - port: 8080 + port: 80 initialDelaySeconds: 5 periodSeconds: 10 timeoutSeconds: 3 ===================================== deploy/k8s/ingress.yaml ===================================== @@ -3,9 +3,6 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: mirror-monitor-api-ingress - annotations: - # Remove the rewrite rule since we want to preserve the API paths - nginx.ingress.kubernetes.io/ssl-redirect: "false" spec: rules: - host: mirror-monitor.local ===================================== deploy/k8s/service.yaml ===================================== @@ -10,4 +10,4 @@ spec: ports: - name: http port: 80 - targetPort: 8080 # Match the containerPort in your Deployment + targetPort: 80 # Match the containerPort in your Deployment View it on GitLab: https://gitlab.c3sl.ufpr.br/root/cli/mirror-monitor/-/compare/97f8a60463fbca... -- View it on GitLab: https://gitlab.c3sl.ufpr.br/root/cli/mirror-monitor/-/compare/97f8a60463fbca... You're receiving this email because of your account on gitlab.c3sl.ufpr.br.