Compare commits

...

3 Commits

Author SHA1 Message Date
philipp lang 5bae240690 --wip-- [skip ci] 2026-10-22 01:57:49 +02:00
philipp lang d05db9f194 Add npm ci when building 2026-10-22 00:34:22 +02:00
philipp lang 12359296fb Remove horizon publish 2026-10-22 00:31:18 +02:00
9 changed files with 50 additions and 146 deletions

View File

@ -1,14 +1,12 @@
FROM php:8.3.36-fpm AS php FROM dunglas/frankenphp:1.12.7-php8.3-bookworm AS php
WORKDIR /app WORKDIR /app
RUN ls /app
RUN apt-get update RUN apt-get update
RUN apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip poppler-utils libpng-dev libjpeg-dev default-mysql-client libzip-dev imagemagick libmagickwand-dev RUN apt-get install -y rsync curl apt-utils unzip poppler-utils default-mysql-client imagemagick
RUN apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils RUN apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils
RUN docker-php-ext-install pdo_mysql curl exif intl mbstring pcntl zip RUN install-php-extensions pdo_mysql curl exif intl mbstring pcntl zip redis imagick gd
RUN pecl install redis && docker-php-ext-enable redis
RUN pecl install imagick && docker-php-ext-enable imagick
RUN docker-php-ext-configure gd --with-jpeg
RUN docker-php-ext-install gd
RUN usermod -s /bin/bash www-data RUN usermod -s /bin/bash www-data
RUN echo 'memory_limit = 2G' >> /usr/local/etc/php/conf.d/99-custom-php-memlimit.ini RUN echo 'memory_limit = 2G' >> /usr/local/etc/php/conf.d/99-custom-php-memlimit.ini
# Allow FrankenPHP to bind to port 80 and write its state when running as www-data
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp \
&& chown -R www-data:www-data /data/caddy /config/caddy

View File

@ -0,0 +1,34 @@
{
auto_https off
admin off
frankenphp
}
:80 {
root * /app/public
encode zstd gzip
header -Server
request_body {
max_size 10MB
}
@hidden {
path */.*
not path /.well-known/*
}
route {
redir /.well-known/carddav /dav 301
redir /.well-known/caldav /dav 301
respond @hidden 403
reverse_proxy /app/adremakey* socketi:6001
reverse_proxy /indexes/members/search meilisearch:7700
header Access-Control-Allow-Credentials "true"
header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
header Access-Control-Allow-Headers "Accept,Authorization,Client-Id,Client-Secret,Cache-Control,Content-Type,Pragma,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,App-Platform,App-Version,Idempotency-Key"
php_server
}
}

View File

@ -1,22 +0,0 @@
FROM composer:2.7.9 AS composer
WORKDIR /app
COPY . /app
RUN composer install --ignore-platform-reqs --no-dev
RUN php artisan telescope:publish
RUN php artisan horizon:publish
FROM node:20.15.0-slim AS node
WORKDIR /app
COPY . /app
RUN npm install && npm run prod && npm run img && rm -R node_modules
FROM nginx:1.21.6-alpine AS nginx
WORKDIR /app
COPY --from=node /app /app
COPY --from=composer /app/public/vendor /app/public/vendor
COPY ./.docker/nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
VOLUME ["/app/public/storage"]
CMD ["nginx", "-g", "daemon off;"]

View File

@ -1,77 +0,0 @@
events {
worker_connections 768;
# multi_accept on;
}
http {
include mime.types;
include fastcgi.conf;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
server_tokens off;
client_max_body_size 10M;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
listen 80;
root /app/public;
charset utf-8;
index index.php;
location /app/adremakey {
proxy_pass http://socketi:6001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
proxy_read_timeout 60;
proxy_connect_timeout 60;
}
location /indexes/members/search {
proxy_pass http://meilisearch:7700/indexes/members/search;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
proxy_read_timeout 60;
proxy_connect_timeout 60;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location = /.well-known/carddav {
return 301 $scheme://$host/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/dav;
}
location ~ /\.ht {
deny all;
}
location ~ /\.(?!well-known).* {
deny all;
}
location ~ \.php$ {
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Client-Id,Client-Secret,Cache-Control,Content-Type,Pragma,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,App-Platform,App-Version,Idempotency-Key' always;
fastcgi_pass php:9000;
fastcgi_index index.php;
}
}
}

View File

@ -6,7 +6,7 @@ RUN composer install --ignore-platform-reqs --no-dev
FROM node:20.15.0-slim AS node FROM node:20.15.0-slim AS node
WORKDIR /app WORKDIR /app
COPY . /app COPY . /app
RUN npm install && npm run prod && npm run img && rm -R node_modules RUN npm ci && npm run prod && npm run img && rm -R node_modules
FROM zoomyboy/adrema-base:latest AS php FROM zoomyboy/adrema-base:latest AS php
COPY --chown=www-data:www-data . /app COPY --chown=www-data:www-data . /app
@ -16,12 +16,14 @@ COPY --chown=www-data:www-data --from=composer /app/vendor /app/vendor
USER www-data USER www-data
RUN php artisan telescope:publish RUN php artisan telescope:publish
RUN php artisan horizon:publish RUN php artisan horizon:publish
RUN php artisan storage:link
USER root USER root
COPY ./.docker/php /bin COPY ./.docker/php /bin
COPY ./.docker/frankenphp/Caddyfile /etc/caddy/Caddyfile
VOLUME ["/app/packages/laravel-nami/.cookies", "/app/storage/app", "/app/resources/views/tex/invoice"] VOLUME ["/app/packages/laravel-nami/.cookies", "/app/storage/app", "/app/resources/views/tex/invoice"]
EXPOSE 9000 EXPOSE 80
CMD /bin/php-entrypoint CMD ["/bin/entrypoint", "app"]

View File

@ -31,7 +31,7 @@ if [ $1 == "app" ]; then
php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force
su www-data -c 'php artisan migrate --force' su www-data -c 'php artisan migrate --force'
php artisan scout:sync-index-settings php artisan scout:sync-index-settings
php-fpm -F -R -O exec su www-data -c 'frankenphp run --config /etc/caddy/Caddyfile'
fi fi

View File

@ -92,21 +92,6 @@ steps:
when: when:
event: tag event: tag
- name: docker_webservice_push
image: plugins/docker
settings:
dockerfile: ./.docker/nginx.Dockerfile
repo: zoomyboy/adrema-webservice
username: zoomyboy
password:
from_secret: docker_hub_token
tags:
- latest
- ${DRONE_TAG}
pull_image: true
when:
event: tag
- name: deploy - name: deploy
image: zoomyboy/adrema-base:latest image: zoomyboy/adrema-base:latest
environment: environment:

View File

@ -1,14 +1,5 @@
version: '3' version: '3'
services: services:
webservice:
image: zoomyboy/adrema-webservice:latest
depends_on:
- php
ports:
- '8000:80'
volumes:
- ./data/storage/public:/app/storage/app/public
php: php:
image: zoomyboy/adrema-app:latest image: zoomyboy/adrema-app:latest
depends_on: depends_on:
@ -16,6 +7,8 @@ services:
- redis - redis
- socketi - socketi
command: /bin/entrypoint app command: /bin/entrypoint app
ports:
- '8000:80'
env_file: env_file:
- .app.env - .app.env
environment: environment:

View File

@ -1,16 +1,5 @@
version: '3' version: '3'
services: services:
webservice:
build:
context: .
dockerfile: ./.docker/nginx.Dockerfile
depends_on:
- php
ports:
- '8000:80'
volumes:
- ./data/storage/public:/app/public/storage
php: php:
build: build:
context: . context: .
@ -20,6 +9,8 @@ services:
- redis - redis
- socketi - socketi
command: /bin/entrypoint app command: /bin/entrypoint app
ports:
- '8000:80'
env_file: env_file:
- .app.env - .app.env
environment: environment: