修改docker部署方式
This commit is contained in:
1 parent
3e7c9420fe
commit
3c6f2c0b7b
18 files changed
+323
-95
No files matched your search
+20
-7
@@ -4,9 +4,18 @@ x-logging: &logging
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
x-backend-build: &backend-build
|
||||
context: ..
|
||||
dockerfile: deploy/Dockerfile
|
||||
args:
|
||||
DEBIAN_MIRROR: ${DEBIAN_MIRROR:-mirrors.tencentyun.com}
|
||||
DEBIAN_IMAGE: ${REGISTRY_PREFIX-mirror.ccs.tencentyun.com/library/}debian:trixie-slim
|
||||
RUST_IMAGE: ${REGISTRY_PREFIX-mirror.ccs.tencentyun.com/library/}rust:1-trixie
|
||||
HASKELL_IMAGE: ${REGISTRY_PREFIX-mirror.ccs.tencentyun.com/library/}haskell:9.10.3-slim-bookworm
|
||||
CARGO_MIRROR_INDEX: ${CARGO_MIRROR_INDEX-sparse+https://rsproxy.cn/index/}
|
||||
services:
|
||||
init:
|
||||
build: { context: ., target: init, args: { DEBIAN_MIRROR: "${DEBIAN_MIRROR:-deb.debian.org}", DEBIAN_IMAGE: "${REGISTRY_PREFIX:-}debian:trixie-slim" } }
|
||||
build: { <<: *backend-build, target: init }
|
||||
volumes:
|
||||
- content:/data
|
||||
- authorization:/auth
|
||||
@@ -17,7 +26,7 @@ services:
|
||||
network_mode: none
|
||||
logging: *logging
|
||||
api:
|
||||
build: { context: ., target: api, args: { DEBIAN_MIRROR: "${DEBIAN_MIRROR:-deb.debian.org}", DEBIAN_IMAGE: "${REGISTRY_PREFIX:-}debian:trixie-slim" } }
|
||||
build: { <<: *backend-build, target: api }
|
||||
depends_on:
|
||||
init: { condition: service_completed_successfully }
|
||||
environment:
|
||||
@@ -49,7 +58,11 @@ services:
|
||||
retries: 3
|
||||
logging: *logging
|
||||
web:
|
||||
build: { context: ../apps/web, args: { NODE_IMAGE: "${REGISTRY_PREFIX:-}node:24-bookworm-slim" } }
|
||||
build:
|
||||
context: ../apps/web
|
||||
args:
|
||||
NODE_IMAGE: ${REGISTRY_PREFIX-mirror.ccs.tencentyun.com/library/}node:24-bookworm-slim
|
||||
NPM_REGISTRY: ${NPM_REGISTRY:-https://mirrors.tencentyun.com/npm/}
|
||||
depends_on:
|
||||
api: { condition: service_healthy }
|
||||
environment:
|
||||
@@ -73,7 +86,7 @@ services:
|
||||
retries: 3
|
||||
logging: *logging
|
||||
ssh:
|
||||
build: { context: ., target: ssh, args: { DEBIAN_MIRROR: "${DEBIAN_MIRROR:-deb.debian.org}", DEBIAN_IMAGE: "${REGISTRY_PREFIX:-}debian:trixie-slim" } }
|
||||
build: { <<: *backend-build, target: ssh }
|
||||
depends_on:
|
||||
init: { condition: service_completed_successfully }
|
||||
api: { condition: service_healthy }
|
||||
@@ -96,7 +109,7 @@ services:
|
||||
restart: unless-stopped
|
||||
logging: *logging
|
||||
db:
|
||||
build: { context: ., target: database, args: { DEBIAN_MIRROR: "${DEBIAN_MIRROR:-deb.debian.org}", DEBIAN_IMAGE: "${REGISTRY_PREFIX:-}debian:trixie-slim" } }
|
||||
build: { <<: *backend-build, target: database }
|
||||
depends_on:
|
||||
init: { condition: service_completed_successfully }
|
||||
environment:
|
||||
@@ -115,7 +128,7 @@ services:
|
||||
restart: unless-stopped
|
||||
logging: *logging
|
||||
db-init:
|
||||
build: { context: ., target: api, args: { DEBIAN_MIRROR: "${DEBIAN_MIRROR:-deb.debian.org}", DEBIAN_IMAGE: "${REGISTRY_PREFIX:-}debian:trixie-slim" } }
|
||||
build: { <<: *backend-build, target: api }
|
||||
profiles: [setup]
|
||||
entrypoint: [chublog-api, provision-db]
|
||||
environment:
|
||||
@@ -130,7 +143,7 @@ services:
|
||||
restart: "no"
|
||||
logging: *logging
|
||||
caddy:
|
||||
image: ${REGISTRY_PREFIX:-}caddy:2
|
||||
image: ${REGISTRY_PREFIX-mirror.ccs.tencentyun.com/library/}caddy:2
|
||||
environment:
|
||||
SITE_ADDRESS: ${SITE_ADDRESS:-localhost}
|
||||
ports: ["${HTTP_BIND:-0.0.0.0}:${HTTP_PORT:-80}:80", "${HTTP_BIND:-0.0.0.0}:${HTTPS_PORT:-443}:443"]
|
||||
|
||||
Reference in new issue
Block a user