Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (ci): Add .vscode/tasks.json and docker-compose.traefik.yml #16

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

!/.github
!/.gitignore
!/.vscode

index.htm
22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "./webize gallery .",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "echo",
"type": "shell",
"command": "./webize clean .",
"group": "build"
},
]
}
65 changes: 65 additions & 0 deletions docker-compose.traefik.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: '2.2'
services:

web:
image: nginx:1.14-alpine
# Enable labels for traefik
labels:
# Override the network that traefik should use
# - "traefik.docker.network=<project_name>_default"
# traefik v1
- "traefik.port=80"
- "traefik.frontend.entryPoints=web"
- "traefik.frontend.rule=HostRegexp:{catchall:.*}"
# - "traefik.frontend.rule=PathPrefix:/"
- "traefik.frontend.headers.customResponseHeaders=Cache-Control:private, no-cache, no-store, must-revalidate, max-age=0, s-maxage=0||Pragma:no-cache"
# traefik v2
- "traefik.http.services.web.loadbalancer.server.port=80"
- "traefik.http.routers.web.entrypoints=web"
- "traefik.http.routers.web.rule=HostRegexp(`{catchall:.*}`)"
# - "traefik.http.routers.web.rule=PathPrefix(`/`)"
- "traefik.http.routers.web.middlewares=nocache"
- "traefik.http.middlewares.nocache.headers.customResponseHeaders.Cache-Control=private, no-cache, no-store, must-revalidate, max-age=0, s-maxage=0"
- "traefik.http.middlewares.nocache.headers.customResponseHeaders.Pragma=no-cache"
networks:
- default
volumes:
- ./:/usr/share/nginx/html:ro

# Run traefik v1 on port 8081
traefik-v1:
image: traefik:v1.7-alpine
command:
# - --logLevel=DEBUG
- --docker
- --docker.watch
- --docker.exposedByDefault=true # Make traefik proxy over the default network created by docker-compose, i.e. '<project_name>_default'. This makes this configuration portable to any project.
- --entryPoints=Name:web Address::80
networks:
- default
ports:
- 8081:80
volumes:
# Allow traefik to listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro

# Run traefik v2 on port 8080
traefik-v2:
image: traefik:v2.4
command:
# - --log.level=DEBUG
- --providers.docker=true
- --providers.docker.exposedbydefault=true # Make traefik proxy over the default network created by docker-compose, i.e. '<project_name>_default'. This makes this configuration portable to any project.
- --entrypoints.web.address=:80
networks:
# The default '<project_name>_default' network
- default
ports:
- 8080:80
volumes:
# Allow traefik to listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro

networks:
# The default '<project_name>_default' network
default: