generated from StanfordBDHG/NextJSTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
43 lines (41 loc) · 1.71 KB
/
docker-compose.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
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
# Based on the Apodini workflow found at: https://github.com/Apodini/ApodiniExample/docker-compose.yml
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#
version: '3.9'
services:
# An Next.js Template
stanford-bdhg-nextjs-template:
container_name: 'stanford-bdhg-nextjs-template'
image: 'ghcr.io/stanfordbdhg/nextjstemplate:latest'
expose:
- '80'
command: ['node', 'server.js']
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:
# Enabling docker provider
- '--providers.docker=true'
# Traefik will listen to incoming request on the port 80 (HTTP)
- '--entrypoints.web.address=:80'
ports:
# 80 on the container is mapped to 80 on the server/VM/your Machine.
- '80:80'
# Traefik needs the docker.sock to detect new docker container
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'