调整 Docker 环境与依赖配置:
- 替换基础镜像为 `php:8.4.15-cli-alpine3.23`,重构依赖安装流程 - 切换包管理工具为 `apk`,添加必要系统库及扩展 - 更新 Composer 脚本及依赖映射 - 优化命令与环境变量配置,增强一致性与兼容性
This commit is contained in:
84
docker-compose.yml
Normal file
84
docker-compose.yml
Normal file
@@ -0,0 +1,84 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/app/Dockerfile
|
||||
image: ars_backend:latest
|
||||
entrypoint: ["/app/docker/app/entrypoint.sh"]
|
||||
volumes:
|
||||
- ./:/app
|
||||
environment:
|
||||
APP_ENV: local
|
||||
APP_DEBUG: "true"
|
||||
APP_URL: http://localhost:8000
|
||||
OCTANE_SERVER: frankenphp
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: pgsql
|
||||
DB_PORT: 5432
|
||||
DB_DATABASE: ars_backend
|
||||
DB_USERNAME: ars
|
||||
DB_PASSWORD: secret
|
||||
REDIS_HOST: redis
|
||||
REDIS_PASSWORD: "null"
|
||||
REDIS_PORT: 6379
|
||||
QUEUE_CONNECTION: redis
|
||||
ports:
|
||||
- "8000:8000"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
depends_on:
|
||||
- pgsql
|
||||
- redis
|
||||
tty: true
|
||||
|
||||
horizon:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/app/Dockerfile
|
||||
image: ars_backend:latest
|
||||
entrypoint: ["/app/docker/app/entrypoint.sh"]
|
||||
environment:
|
||||
CONTAINER_ROLE: horizon
|
||||
APP_ENV: local
|
||||
APP_DEBUG: "true"
|
||||
APP_URL: http://localhost:8000
|
||||
OCTANE_SERVER: frankenphp
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: pgsql
|
||||
DB_PORT: 5432
|
||||
DB_DATABASE: ars_backend
|
||||
DB_USERNAME: ars
|
||||
DB_PASSWORD: secret
|
||||
REDIS_HOST: redis
|
||||
REDIS_PASSWORD: "null"
|
||||
REDIS_PORT: 6379
|
||||
QUEUE_CONNECTION: redis
|
||||
volumes:
|
||||
- ./:/app
|
||||
depends_on:
|
||||
- pgsql
|
||||
- redis
|
||||
tty: true
|
||||
|
||||
pgsql:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ars_backend
|
||||
POSTGRES_USER: ars
|
||||
POSTGRES_PASSWORD: secret
|
||||
volumes:
|
||||
- pgsql_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
command: redis-server --appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
volumes:
|
||||
pgsql_data:
|
||||
redis_data:
|
||||
Reference in New Issue
Block a user