-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (67 loc) · 2.51 KB
/
docker-compose.yml
File metadata and controls
69 lines (67 loc) · 2.51 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
##
# @description Services
# @author C. M. de Picciotto <d3p1@d3p1.dev> (https://d3p1.dev/)
# @note This is a base Docker Compose file that will be extended
# by other files related to the environment
# (i.e., a Docker Compose file for the dev or prod environment)
# @note It is added a `cli` profile to create the service
# on demand (so it is not created when `docker compose up`
# is executed). In this way, the user can manage
# when it is required to execute it
# @link https://docs.docker.com/compose/profiles/
# @todo For now, the `d3p1/jsruntime` image just supports
# `node` version number `22.21` and `bun` version number `1.3`.
# Add support to other versions
# and/or improve how versions are handled
##
services:
traefik:
image:
traefik:v${BASE_TRAEFIK_VERSION}
ports:
- 80:80
- 443:443
depends_on:
- web
volumes:
- ${BASE_DOCKER_PATH}:/var/run/docker.sock
environment:
- TRAEFIK_ENTRYPOINTS_WEB_ADDRESS=:80
- TRAEFIK_ENTRYPOINTS_WEBSECURE_ADDRESS=:443
- TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_TO=websecure
- TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_SCHEME=https
- TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_PERMANENT=true
- TRAEFIK_PING=true
- TRAEFIK_PROVIDERS_DOCKER=true
restart:
always
web:
image:
d3p1/jsruntime:n${BASE_NODE_VERSION}-b${BASE_BUN_VERSION}
expose:
- 3000
env_file:
- services/runtime/.env
labels:
- traefik.enable=true
- traefik.http.routers.https-next.entrypoints=websecure
- traefik.http.routers.https-next.tls=true
- traefik.http.routers.https-next.rule=Host(`${BASE_DOMAIN}`) || Host(`www.${BASE_DOMAIN}`)
- traefik.http.routers.https-next.service=https-next
- traefik.http.services.https-next.loadbalancer.server.port=3000
- traefik.http.routers.http-next.entrypoints=web
- traefik.http.routers.http-next.tls=false
- traefik.http.routers.http-next.rule=Host(`${BASE_DOMAIN}`) || Host(`www.${BASE_DOMAIN}`)
- traefik.http.routers.http-next.service=http-next
- traefik.http.services.http-next.loadbalancer.server.port=3000
restart:
always
cli:
image:
d3p1/jsruntime:n${BASE_NODE_VERSION}-b${BASE_BUN_VERSION}-dev
env_file:
- services/runtime/.env
labels:
- traefik.enable=false
profiles:
- cli