mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 04:04:45 +02:00
Revert "wip"
This reverts commit 649e82d0c06f068f08b024a1f8fc4837b488cb3d.
This commit is contained in:
parent
9779365432
commit
4fc8d98a0f
@ -1,3 +1,3 @@
|
|||||||
APP_KEY=
|
APP_KEY=
|
||||||
|
|
||||||
DB_DATABASE=database.sqlite
|
DB_DATABASE=docker/database.sqlite
|
||||||
|
34
.github/docker/entrypoint.sh
vendored
34
.github/docker/entrypoint.sh
vendored
@ -2,12 +2,40 @@
|
|||||||
|
|
||||||
#mkdir -p /var/log/supervisord/ /var/log/php8/ \
|
#mkdir -p /var/log/supervisord/ /var/log/php8/ \
|
||||||
|
|
||||||
## Make sure the app key is set
|
## check for .env file and generate app keys if missing
|
||||||
php artisan key:generate
|
if [ -f /pelican-data/.env ]; then
|
||||||
|
echo "external vars exist."
|
||||||
|
rm -rf /var/www/html/.env
|
||||||
|
else
|
||||||
|
echo "external vars don't exist."
|
||||||
|
rm -rf /var/www/html/.env
|
||||||
|
touch /pelican-data/.env
|
||||||
|
|
||||||
|
## manually generate a key because key generate --force fails
|
||||||
|
if [ -z $APP_KEY ]; then
|
||||||
|
echo -e "Generating key."
|
||||||
|
APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
|
||||||
|
echo -e "Generated app key: $APP_KEY"
|
||||||
|
echo -e "APP_KEY=$APP_KEY" > /pelican-data/.env
|
||||||
|
else
|
||||||
|
echo -e "APP_KEY exists in environment, using that."
|
||||||
|
echo -e "APP_KEY=$APP_KEY" > /pelican-data/.env
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
ln -s /pelican-data/.env /var/www/html/
|
||||||
|
|
||||||
|
touch /pelican-data/database.sqlite
|
||||||
|
|
||||||
|
if ! grep -q "APP_KEY=" .env || grep -q "APP_KEY=$" .env; then
|
||||||
|
echo "Generating APP_KEY..."
|
||||||
|
php artisan key:generate --force
|
||||||
|
else
|
||||||
|
echo "APP_KEY is already set."
|
||||||
|
fi
|
||||||
|
|
||||||
## make sure the db is set up
|
## make sure the db is set up
|
||||||
echo -e "Migrating and Seeding Database"
|
echo -e "Migrating and Seeding Database"
|
||||||
touch database/database.sqlite
|
|
||||||
php artisan migrate --force
|
php artisan migrate --force
|
||||||
|
|
||||||
## start cronjobs for the queue
|
## start cronjobs for the queue
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
{$APP_URL} {
|
{$APP_URL} {
|
||||||
root * /srv/public
|
root * /var/www/html/public
|
||||||
encode gzip
|
encode gzip
|
||||||
php_fastcgi panel:9000
|
|
||||||
|
php_fastcgi 127.0.0.1:9000
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
|
12
Dockerfile
12
Dockerfile
@ -20,10 +20,11 @@ WORKDIR /var/www/html
|
|||||||
RUN apk update && apk add --no-cache \
|
RUN apk update && apk add --no-cache \
|
||||||
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
||||||
zip unzip curl \
|
zip unzip curl \
|
||||||
ca-certificates supervisor
|
caddy ca-certificates supervisor \
|
||||||
|
&& docker-php-ext-install bcmath gd intl zip opcache pcntl posix
|
||||||
|
|
||||||
# Additional PHP Extensions
|
# Copy the Caddyfile to the container
|
||||||
RUN docker-php-ext-install bcmath gd intl zip opcache pcntl posix
|
COPY Caddyfile /etc/caddy/Caddyfile
|
||||||
|
|
||||||
# Copy the application code to the container
|
# Copy the application code to the container
|
||||||
COPY . .
|
COPY . .
|
||||||
@ -43,10 +44,13 @@ RUN chmod -R 755 /var/www/html/storage \
|
|||||||
HEALTHCHECK --interval=5m --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=5m --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost/up || exit 1
|
CMD curl -f http://localhost/up || exit 1
|
||||||
|
|
||||||
|
EXPOSE 80:2019
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
VOLUME /pelican-data
|
VOLUME /pelican-data
|
||||||
|
|
||||||
# Start PHP-FPM
|
# Start PHP-FPM
|
||||||
CMD ["sh", "-c", "php-fpm"]
|
CMD ["sh", "-c", "php-fpm & caddy run --config /etc/caddy/Caddyfile --adapter caddyfile"]
|
||||||
|
|
||||||
ENTRYPOINT [ "/bin/ash", ".github/docker/entrypoint.sh" ]
|
ENTRYPOINT [ "/bin/ash", ".github/docker/entrypoint.sh" ]
|
||||||
# CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
|
# CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
|
||||||
|
37
compose.yml
37
compose.yml
@ -30,47 +30,22 @@ x-common:
|
|||||||
services:
|
services:
|
||||||
panel:
|
panel:
|
||||||
image: panel
|
image: panel
|
||||||
restart: unless-stopped
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "80:2019"
|
||||||
|
- "443:443"
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
volumes:
|
volumes:
|
||||||
- pelican-data:/pelican-data
|
- pelican-data:/pelican-data
|
||||||
- .:/srv
|
- pelican-logs:/var/www/html/storage/logs
|
||||||
environment:
|
environment:
|
||||||
<<: [*panel-environment, *mail-environment]
|
<<: [*panel-environment, *mail-environment]
|
||||||
working_dir: /srv
|
|
||||||
|
|
||||||
caddy:
|
|
||||||
image: caddy:2-alpine
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
||||||
- caddy-data:/data
|
|
||||||
- caddy-config:/config
|
|
||||||
- .:/srv
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
- 443:443
|
|
||||||
env_file:
|
|
||||||
- ./.env.docker
|
|
||||||
environment:
|
|
||||||
<<: [ *panel-environment, *mail-environment ]
|
|
||||||
XDG_DATA_HOME: /pelican-data
|
XDG_DATA_HOME: /pelican-data
|
||||||
logging:
|
|
||||||
driver: "json-file"
|
|
||||||
options:
|
|
||||||
max-size: "1M"
|
|
||||||
max-file: "10"
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pelican-data:
|
pelican-data:
|
||||||
caddy-data:
|
pelican-logs:
|
||||||
caddy-config:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user