Updated Configuration

This commit is contained in:
2019-05-03 17:04:28 +01:00
parent d552720642
commit 12f84245f8
3 changed files with 9 additions and 6 deletions

View File

@@ -4,13 +4,16 @@ image: docker:latest
services: services:
- docker:dind - docker:dind
variables:
DOMAIN: "Fluttershub.com"
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-master: build-master:
stage: build stage: build
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" . - docker build --pull --label traefik.frontend.rule="Host:${DOMAIN}" -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE" - docker push "$CI_REGISTRY_IMAGE"
only: only:
- master - master
@@ -18,7 +21,7 @@ build-master:
build: build:
stage: build stage: build
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . - docker build --pull --label traefik.frontend.rule="Host:${CI_COMMIT_REF_SLUG}.fluttershub.com" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except: except:
- master - master

View File

@@ -17,7 +17,7 @@ COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/web.conf /etc/nginx/conf.d/web.conf COPY docker/web.conf /etc/nginx/conf.d/web.conf
LABEL traefik.backend=fluttershub_home LABEL traefik.backend=fluttershub_home
LABEL traefik.frontend.rule="Host:fluttershub.com" LABEL traefik.frontend.rule="Host:${CI_COMMIT_REF_SLUG}fluttershub.com"
LABEL traefik.docker.network=web LABEL traefik.docker.network=web
LABEL traefik.frontend.redirect.entryPoint=https LABEL traefik.frontend.redirect.entryPoint=https
LABEL traefik.enable=true LABEL traefik.enable=true

View File

@@ -2,11 +2,11 @@ version: "3"
services: services:
home: home:
image: mrflutters/home:1.0.0 image: registry.gitlab.com/mrflutters/flutters-website-dockertesting:dev
restart: always restart: always
networks: networks:
- web - external
container_name: Fluttershub_home container_name: Fluttershub_home
networks: networks:
web: external:
external: true external: true