I try to make addon with nginx + php8 that start web application invoiceplane.
addon installed ok. but when I try to start it I get error: s6-overlay-suexec: fatal: can only run as pid 1
Any idea?
Here are files:
Dockerfile
ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base:latest
FROM ${BUILD_FROM}
RUN apk update && \
apk add --no-cache nginx php php-fpm php-pdo php-pdo_mysql php-json php-openssl php-zip php-curl php-phar php-dom php-xml && \
rm -rf /var/cache/apk/*
RUN wget -O /tmp/invoiceplane.zip https://github.com/InvoicePlane/InvoicePlane/releases/download/v1.6.1-beta-2/v1.6.1-beta-2.zip && \
unzip /tmp/invoiceplane.zip -d /var/www && \
chown -R nobody:nobody /var/www/ip && \
chmod -R 775 /var/www/ip/uploads && \
chmod -R 775 /var/www/ip/application/cache && \
rm /tmp/invoiceplane.zip
COPY nginx.conf /etc/nginx/nginx.conf
COPY php.ini /etc/php8/conf.d/custom.ini
COPY run.sh /run.sh
RUN chmod a+x /run.sh
# Install tini
#ENV TINI_VERSION v0.19.0
#ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /bin/tini
#RUN chmod +x /bin/tini
#CMD ["/bin/tini", "--", "/run.sh"]
CMD [ "/run.sh" ]
config.yaml
arch:
- amd64
description: "Home Assistant addon with web server and PHP 8 for InvoicePlane"
slug: "invoiceplane-addon"
version: "0.0.008a"
log_level: info
docker_image: https://github.com/lpt2007/hassos-addons-testing/tree/main/invoiceplane
name: InvoicePlane
run.sh
#!/usr/bin/env bash
set -e
echo "Start php-fpm"
php-fpm81 -D
echo "Start nginx"
nginx -g 'daemon off;'
nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /var/www/ip;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /40x.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#location /ip {
# try_files $uri $uri/ /index.php$is_args$args;
#}
#location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
# access_log
}
}
php.ini
upload_max_filesize=20M
post_max_size=20M
max_execution_time=600