chore: support local docker build deployment
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
FROM phpswoole/swoole:php8.2-alpine
|
||||
|
||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||
|
||||
# Install PHP extensions one by one with lower optimization level for ARM64 compatibility
|
||||
RUN CFLAGS="-O0" install-php-extensions pcntl && \
|
||||
CFLAGS="-O0 -g0" install-php-extensions bcmath && \
|
||||
install-php-extensions zip && \
|
||||
install-php-extensions redis && \
|
||||
apk --no-cache add shadow sqlite mysql-client mysql-dev mariadb-connector-c git patch supervisor redis && \
|
||||
addgroup -S -g 1000 www && adduser -S -G www -u 1000 www && \
|
||||
(getent group redis || addgroup -S redis) && \
|
||||
(getent passwd redis || adduser -S -G redis -H -h /data redis)
|
||||
|
||||
WORKDIR /www
|
||||
|
||||
COPY .docker /
|
||||
COPY . /www
|
||||
COPY .docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
RUN composer install --no-cache --no-dev \
|
||||
&& php artisan storage:link \
|
||||
&& chown -R www:www /www \
|
||||
&& chmod -R 775 /www \
|
||||
&& mkdir -p /data \
|
||||
&& chown redis:redis /data
|
||||
|
||||
ENV ENABLE_WEB=true \
|
||||
ENABLE_HORIZON=true \
|
||||
ENABLE_REDIS=false
|
||||
|
||||
EXPOSE 7001
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
+22
-12
@@ -1,31 +1,41 @@
|
||||
services:
|
||||
web:
|
||||
image: ghcr.io/cedar2025/xboard:new
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.local
|
||||
image: xboard-local:latest
|
||||
volumes:
|
||||
- ./.docker/.data/redis/:/data/
|
||||
- ./:/www/
|
||||
- ./.env:/www/.env
|
||||
- ./.docker/.data/:/www/.docker/.data
|
||||
- ./storage/logs:/www/storage/logs
|
||||
- ./storage/theme:/www/storage/theme
|
||||
- ./plugins:/www/plugins
|
||||
environment:
|
||||
- docker=true
|
||||
depends_on:
|
||||
- redis
|
||||
network_mode: host
|
||||
command: php artisan octane:start --port=7001 --host=0.0.0.0
|
||||
restart: always
|
||||
# network_mode: host
|
||||
command: php artisan octane:start --host=0.0.0.0 --port=7001
|
||||
restart: on-failure
|
||||
ports:
|
||||
- 7001:7001
|
||||
horizon:
|
||||
image: ghcr.io/cedar2025/xboard:new
|
||||
image: xboard-local:latest
|
||||
volumes:
|
||||
- ./.docker/.data/redis/:/data/
|
||||
- ./:/www/
|
||||
restart: always
|
||||
network_mode: host
|
||||
- ./.env:/www/.env
|
||||
- ./.docker/.data/:/www/.docker/.data
|
||||
- ./storage/logs:/www/storage/logs
|
||||
- ./plugins:/www/plugins
|
||||
restart: on-failure
|
||||
# network_mode: host
|
||||
command: php artisan horizon
|
||||
depends_on:
|
||||
- redis
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
command: redis-server --unixsocket /data/redis.sock --unixsocketperm 777
|
||||
command: redis-server --unixsocket /data/redis.sock --unixsocketperm 777 --save 900 1 --save 300 10 --save 60 10000
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./.docker/.data/redis:/data
|
||||
sysctls:
|
||||
net.core.somaxconn: 1024
|
||||
|
||||
Reference in New Issue
Block a user