Skip to content

Instantly share code, notes, and snippets.

@Yatekii
Created May 24, 2020 18:15
Show Gist options
  • Save Yatekii/92a9221aa70687fb3f539cd1a08e61cb to your computer and use it in GitHub Desktop.
Save Yatekii/92a9221aa70687fb3f539cd1a08e61cb to your computer and use it in GitHub Desktop.
version: '3'
# networks:
# $CI_ENVIRONMENT_SLUG-net:
volumes:
cache:
services:
static:
image: "$CI_REGISTRY_IMAGE/static:$CI_COMMIT_BRANCH"
container_name: "$CI_ENVIRONMENT_SLUG-static"
# networks:
# - $CI_ENVIRONMENT_SLUG-net
environment:
- NGINX_PORT=8080
volumes:
- cache:/var/cache/nginx
labels:
- "traefik.http.routers.$CI_ENVIRONMENT_SLUG-static.rule=Host(`$CI_ENVIRONMENT_SLUG.xyz.ch`) && PathPrefix(`/static`)"
- "traefik.http.services.$CI_ENVIRONMENT_SLUG.loadbalancer.server.port=8080"
# - "traefik.docker.network=deploy_$CI_ENVIRONMENT_SLUG-net"
- "traefik.enable=true"
- "traefik.default.protocol=http"
restart: "always"
tty: yes
stdin_open: true
app:
image: "$CI_REGISTRY_IMAGE/app:$CI_COMMIT_BRANCH"
container_name: "$CI_ENVIRONMENT_SLUG-app"
# networks:
# - $CI_ENVIRONMENT_SLUG-net
environment:
- "PORT=5000"
labels:
- "traefik.http.routers.$CI_ENVIRONMENT_SLUG-app.rule=Host(`$CI_ENVIRONMENT_SLUG.xyz.ch`)"
- "traefik.http.services.$CI_ENVIRONMENT_SLUG.loadbalancer.server.port=5000"
# - "traefik.docker.network=deploy_$CI_ENVIRONMENT_SLUG-net"
- "traefik.enable=true"
- "traefik.default.protocol=http"
restart: "always"
tty: yes
stdin_open: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment