generated from Apodini/ApodiniTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-development.yml
53 lines (51 loc) · 1.98 KB
/
docker-compose-development.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# This source file is part of the Horn as a Service open source project
#
# SPDX-FileCopyrightText: 2022 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
version: '3.9'
services:
# Horn as a Service
horn-as-a-service:
container_name: "horn-as-a-service"
image: "jass2022/hornasaservice:latest"
build:
context: ./
dockerfile: ./Dockerfile
expose:
- "80"
command: ["--port", "80"]
labels:
# The domain the service will respond to
- "traefik.http.routers.backend.rule=Host(`localhost`)"
# Allow request only from the predefined entry point named "web"
- "traefik.http.routers.backend.entrypoints=web"
# We need to define the a service and specify, on which port our server is reachable
- "traefik.http.services.backend-service.loadbalancer.server.port=80"
# We have to add this service to our router "backend". That's how the router knows where to forward the requests
- "traefik.http.routers.backend.service=backend-service"
# Reverse Proxy to protect our service from direct access
traefik:
container_name: "traefik"
image: "traefik:v2.4"
command:
# Enable Debug output
- "--log.level=DEBUG"
# Enable the api and the traefik dashboard for debugging purposes, which can be reached under 127.0.0.1:8080
- "--api.insecure=true"
- "--api.dashboard=true"
# Enabling docker provider
- "--providers.docker=true"
# Traefik will listen to incoming request on the port 8090
- "--entrypoints.web.address=:80"
ports:
# 8080 on the container is mapped to 8080 on the server/VM/your Machine.
# Port 8080 is where the api traefik dashboard is located
- "8080:8080"
# Port 80 is where our example-web-service is running
- "80:80"
# Traefik needs the docker.sock to detect new docker container
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"