-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.pypi.yml
46 lines (43 loc) · 1.56 KB
/
docker-compose.pypi.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
version: '3.8'
services:
# BEGIN pypi
private_pypi:
image: pypiserver/pypiserver:latest
container_name: private_pypi
restart: always
command: -P /data/auth/.htpasswd -a update,download,list /data/packages
volumes:
- ./pypi_data:/data/packages
- ./pypi_auth:/data/auth
env_file:
- ./.pypi.env
labels:
# Enable Traefik for this specific "pypi-api" service
- traefik.enable=true
# Use the traefik-network network (defined in docker.compose.traefik.yml)
- traefik.docker.network=traefik-network
# Make Traefik use this domain in HTTP
- traefik.http.routers.pypi-api-http.entrypoints=http
- traefik.http.routers.pypi-api-http.rule=Host(`${pypi_url}`)
# Make Traefik use this domain in HTTPS
- traefik.http.routers.pypi-api-https.entrypoints=https
- traefik.http.routers.pypi-api-https.rule=Host(`${pypi_url}`)
- traefik.http.routers.pypi-api-https.tls=true
# Use the "le" (Let's Encrypt) resolver
- traefik.http.routers.pypi-api-https.tls.certresolver=le
# Plug middleware to redirect HTTP to HTTPS
- traefik.http.routers.pypi-api-http.middlewares=https-redirect
- traefik.http.routers.pypi-api-https.middlewares=secured
networks:
- app-network
# Use the public network created to be shared between Traefik and
# any other service that needs to be publicly available with HTTPS
- traefik-network
# END pypi
# NETWORKS
networks:
app-network:
name: app-network
external: true
traefik-network:
external: true