mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-09 21:42:57 +00:00
use octane & frankenphp for docker image
This commit is contained in:
parent
76d4b9eba3
commit
fc9f0787a0
7 changed files with 249 additions and 50 deletions
|
|
@ -1,28 +1,23 @@
|
|||
# Stage 1: Build
|
||||
FROM joseluisq/php-fpm:8.4 AS build
|
||||
FROM dunglas/frankenphp
|
||||
|
||||
RUN apk add --no-cache nodejs npm
|
||||
# Copy php.ini
|
||||
COPY ./deploy/php.ini $PHP_INI_DIR/php.ini
|
||||
|
||||
WORKDIR /var/www/html
|
||||
COPY --chown=www-data:www-data . .
|
||||
RUN apt update -y && apt install -y git nodejs npm
|
||||
COPY --from=composer:lts /usr/bin/composer /usr/bin/composer
|
||||
|
||||
RUN chmod -R 775 /var/www/html/storage \
|
||||
&& chmod -R 775 /var/www/html/bootstrap/cache
|
||||
RUN install-php-extensions \
|
||||
gd \
|
||||
opcache \
|
||||
redis \
|
||||
mongodb
|
||||
|
||||
RUN composer install --no-dev --prefer-dist \
|
||||
&& npm install \
|
||||
&& npm run build
|
||||
COPY . /app
|
||||
|
||||
RUN chown -R www-data:www-data /var/www/html/vendor \
|
||||
&& chmod -R 775 /var/www/html/vendor
|
||||
RUN cp .env.example .env
|
||||
RUN sed -i'' -e 's/^APP_ENV=.*/APP_ENV=production/' -e 's/^APP_DEBUG=.*/APP_DEBUG=false/' .env
|
||||
|
||||
# Stage 2: Deploy
|
||||
FROM joseluisq/php-fpm:8.4
|
||||
RUN composer install --ignore-platform-reqs --no-dev -a
|
||||
RUN npm install && npm run build
|
||||
|
||||
COPY --from=build /var/www/html /var/www/html
|
||||
WORKDIR /var/www/html
|
||||
|
||||
VOLUME ["/var/www/html/storage/app"]
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=9000", "--tries=1"]
|
||||
ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--host=0.0.0.0"]
|
||||
|
|
|
|||
|
|
@ -7,35 +7,9 @@ services:
|
|||
context: ../
|
||||
dockerfile: ./deploy/Dockerfile
|
||||
volumes:
|
||||
- ../storage/app:/var/www/html/storage/app
|
||||
environment:
|
||||
APP_NAME: ${APP_NAME}
|
||||
APP_ENV: ${APP_ENV}
|
||||
APP_DEBUG: ${APP_DEBUG}
|
||||
APP_KEY: ${APP_KEY}
|
||||
APP_URL: ${APP_URL}
|
||||
DB_CONNECTION: ${DB_CONNECTION}
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_NAME: ${DB_NAME}
|
||||
AUTHENTIK_BASE_URL: ${AUTHENTIK_BASE_URL}
|
||||
AUTHENTIK_CLIENT_ID: ${AUTHENTIK_CLIENT_ID}
|
||||
AUTHENTIK_CLIENT_SECRET: ${AUTHENTIK_CLIENT_SECRET}
|
||||
AUTHENTIK_REDIRECT_URI: ${APP_URL}/auth/callback
|
||||
SESSION_DRIVER: ${SESSION_DRIVER}
|
||||
FILESYSTEM_DISK: ${FILESYSTEM_DISK}
|
||||
CACHE_STORE: ${CACHE_STORE}
|
||||
REDIS_CLIENT: ${REDIS_CLIENT}
|
||||
REDIS_HOST: ${REDIS_HOST}
|
||||
MAIL_MAILER: ${MAIL_MAILER}
|
||||
MAIL_SCHEME: ${MAIL_SCHEME}
|
||||
MAIL_HOST: ${MAIL_HOST}
|
||||
MAIL_PORT: ${MAIL_PORT}
|
||||
MAIL_USERNAME: ${MAIL_USERNAME}
|
||||
MAIL_PASSWORD: ${MAIL_PASSWORD}
|
||||
MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS}
|
||||
MAIL_FROM_NAME: ${MAIL_FROM_NAME}
|
||||
- .:/app
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "8000:8000"
|
||||
networks:
|
||||
- nyaabooru-internal
|
||||
depends_on:
|
||||
|
|
|
|||
2
deploy/php.ini
Normal file
2
deploy/php.ini
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
upload_max_filesize = 64M
|
||||
post_max_filesize = 72M
|
||||
Loading…
Add table
Add a link
Reference in a new issue