Commit d4dbe553 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request redmic-project/static-pages!15
parents 425bed73 0a126713
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -5,15 +5,22 @@ include:
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/deployment.yml'
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/deployment-custom-image.yml'

stages:
  - pre-package
  - package
  - test-package
  - post-package
  - deploy

variables:
  STACK: static-pages
  PROJECT_PARENT_NAME: static-pages

.deploy:
  variables:
    STACK: ${PROJECT_PARENT_NAME}
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}
  environment:
    url: https://${DD_STATIC_SUBDOMAIN}.${PUBLIC_HOSTNAME}
+7 −3
Original line number Diff line number Diff line
FROM nginx:1.15-alpine
ARG NGINX_IMAGE_TAG=1.19-alpine

LABEL maintainer="info@redmic.es"
FROM nginx:${NGINX_IMAGE_TAG}

COPY static-pages.conf /etc/nginx/conf.d
LABEL maintainer="info@redmic.es"

COPY static-pages.conf /etc/nginx/conf.d/default.conf
COPY content /usr/share/nginx/html

HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=10 \
	CMD wget --spider -q http://localhost/nginx-health || exit 1
+1 −1
Original line number Diff line number Diff line
# static-pages

TODO
 No newline at end of file
Collection of static pages (welcome, error, etc.)
+3 −4
Original line number Diff line number Diff line
INTERNAL_PORT=80
PUBLIC_HOSTNAME=redmic.es
STATIC_SUBDOMAIN=static
BACKEND_NAME=static-pages
NGINX_IMAGE_TAG=1.19-alpine

PUBLIC_HOSTNAME=change.me
+18 −21
Original line number Diff line number Diff line
@@ -2,42 +2,39 @@ version: '3.5'

services:
  static-pages:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    image: ${IMAGE_NAME:-registry.gitlab.com/redmic-project/static-pages}:${IMAGE_TAG:-latest}
    build:
      context: ..
      dockerfile: ${DOCKERFILE:-Dockerfile}
      args:
        NGINX_IMAGE_TAG:
    networks:
      traefik-net:
    healthcheck:
      test: wget --spider -q http://localhost
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 1m
    deploy:
      mode: global
      restart_policy:
        delay: ${RESTART_DELAY:-10s}
      update_config:
        delay: ${UPDATE_DELAY:-1m}
      labels:
        traefik.static.frontend.rule: Host:${STATIC_SUBDOMAIN}.${PUBLIC_HOSTNAME}
        traefik.static.backend: ${BACKEND_NAME}
        traefik.static.port: '${INTERNAL_PORT}'
        traefik.static.frontend.rule: Host:${STATIC_SUBDOMAIN:-static}.${PUBLIC_HOSTNAME}
        traefik.web-error-handle.frontend.rule: Host:${PUBLIC_HOSTNAME};ReplacePathRegex:^.*?(resources/[^/]+\\.\\w+)?$$ /maintenance/$$1
        traefik.web-error-handle.frontend.priority: '1'
        traefik.web-error-handle.backend: ${BACKEND_NAME}
        traefik.web-error-handle.port: '${INTERNAL_PORT}'
        traefik.old-viewer.frontend.rule: Host:www.redmic.es;PathPrefix:/flexviewers/visor
        traefik.old-viewer.frontend.redirect.regex: ^.*$$
        traefik.old-viewer.frontend.redirect.replacement: https://${PUBLIC_HOSTNAME}/atlas
        traefik.old-viewer.backend: ${BACKEND_NAME}
        traefik.old-viewer.port: '${INTERNAL_PORT}'
      restart_policy:
        delay: 5s
        window: 1m
        traefik.backend: ${BACKEND_NAME:-static-pages}
        traefik.port: '${PORT:-80}'
      resources:
        limits:
          cpus: '0.1'
          memory: 64M
          cpus: '${RESOURCES_LIMITS_CPUS:-0.1}'
          memory: ${RESOURCES_LIMITS_MEMORY:-32M}
        reservations:
          cpus: '0.001'
          memory: 8M
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-4M}

networks:
  traefik-net:
    name: ${TRAEFIK_NET_NAME:-traefik-net}
    driver: ${TRAEFIK_NET_DRIVER:-overlay}
    external: true
Loading