docker-compose.yml
· 1.9 KiB · YAML
原始文件
secrets:
# Secrets are single-line text files where the sole content is the secret
# Paths in this example assume that secrets are kept in local folder called ".secrets"
DB_ROOT_PWD:
file: .secrets/db_root_pwd.txt
MYSQL_PWD:
file: .secrets/mysql_pwd.txt
services:
npm:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy-manager
restart: unless-stopped
ports:
# Public HTTP Port:
- '80:80'
# Public HTTPS Port:
- '443:443'
# Admin Web Port:
# - '81:81'
environment:
# PUID: 1000
# ID: 1000
# These are the settings to access your db
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "npm"
# DB_MYSQL_PASSWORD: "npm" # use secret instead
DB_MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
DB_MYSQL_NAME: "npm"
# If you would rather use Sqlite, remove all DB_MYSQL_* lines above
# Uncomment this if IPv6 is not enabled on your host
DISABLE_IPV6: 'true'
networks:
- npm-internal
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
secrets:
- MYSQL_PWD
depends_on:
- db
healthcheck:
test: ["CMD", "/usr/bin/check-health"]
interval: 10s
timeout: 3s
db:
image: 'jc21/mariadb-aria:latest'
container_name: db
restart: unless-stopped
environment:
# MYSQL_ROOT_PASSWORD: "npm" # use secret instead
MYSQL_ROOT_PASSWORD__FILE: /run/secrets/DB_ROOT_PWD
MYSQL_DATABASE: "npm"
MYSQL_USER: "npm"
# MYSQL_PASSWORD: "npm" # use secret instead
MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
MARIADB_AUTO_UPGRADE: '1'
networks:
- npm-internal
volumes:
- ./mysql:/var/lib/mysql
secrets:
- DB_ROOT_PWD
- MYSQL_PWD
networks:
npm-internal:
name: npm-internal
external: true
| 1 | secrets: |
| 2 | # Secrets are single-line text files where the sole content is the secret |
| 3 | # Paths in this example assume that secrets are kept in local folder called ".secrets" |
| 4 | DB_ROOT_PWD: |
| 5 | file: .secrets/db_root_pwd.txt |
| 6 | MYSQL_PWD: |
| 7 | file: .secrets/mysql_pwd.txt |
| 8 | |
| 9 | services: |
| 10 | npm: |
| 11 | image: 'jc21/nginx-proxy-manager:latest' |
| 12 | container_name: nginx-proxy-manager |
| 13 | restart: unless-stopped |
| 14 | ports: |
| 15 | # Public HTTP Port: |
| 16 | - '80:80' |
| 17 | # Public HTTPS Port: |
| 18 | - '443:443' |
| 19 | # Admin Web Port: |
| 20 | # - '81:81' |
| 21 | environment: |
| 22 | # PUID: 1000 |
| 23 | # ID: 1000 |
| 24 | # These are the settings to access your db |
| 25 | DB_MYSQL_HOST: "db" |
| 26 | DB_MYSQL_PORT: 3306 |
| 27 | DB_MYSQL_USER: "npm" |
| 28 | # DB_MYSQL_PASSWORD: "npm" # use secret instead |
| 29 | DB_MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD |
| 30 | DB_MYSQL_NAME: "npm" |
| 31 | # If you would rather use Sqlite, remove all DB_MYSQL_* lines above |
| 32 | # Uncomment this if IPv6 is not enabled on your host |
| 33 | DISABLE_IPV6: 'true' |
| 34 | networks: |
| 35 | - npm-internal |
| 36 | volumes: |
| 37 | - ./data:/data |
| 38 | - ./letsencrypt:/etc/letsencrypt |
| 39 | secrets: |
| 40 | - MYSQL_PWD |
| 41 | depends_on: |
| 42 | - db |
| 43 | healthcheck: |
| 44 | test: ["CMD", "/usr/bin/check-health"] |
| 45 | interval: 10s |
| 46 | timeout: 3s |
| 47 | |
| 48 | db: |
| 49 | image: 'jc21/mariadb-aria:latest' |
| 50 | container_name: db |
| 51 | restart: unless-stopped |
| 52 | environment: |
| 53 | # MYSQL_ROOT_PASSWORD: "npm" # use secret instead |
| 54 | MYSQL_ROOT_PASSWORD__FILE: /run/secrets/DB_ROOT_PWD |
| 55 | MYSQL_DATABASE: "npm" |
| 56 | MYSQL_USER: "npm" |
| 57 | # MYSQL_PASSWORD: "npm" # use secret instead |
| 58 | MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD |
| 59 | MARIADB_AUTO_UPGRADE: '1' |
| 60 | networks: |
| 61 | - npm-internal |
| 62 | volumes: |
| 63 | - ./mysql:/var/lib/mysql |
| 64 | secrets: |
| 65 | - DB_ROOT_PWD |
| 66 | - MYSQL_PWD |
| 67 | |
| 68 | networks: |
| 69 | npm-internal: |
| 70 | name: npm-internal |
| 71 | external: true |