Skip to content

Commit 87e125d

Browse files
committed
key:generate is f'd
1 parent 63b76c6 commit 87e125d

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.dev/docker/entrypoint.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@ cd /app
77
if [ -f /app/var/.env ]; then
88
echo "external vars exist"
99
rm /app/.env
10+
1011
ln -s /app/var/.env /app/
1112
else
1213
echo "external vars don't exist"
13-
php artisan key:generate --force
14-
cp /app/.env /app/var/
14+
rm /app/.env
15+
touch /app/var/.env
16+
17+
## manually generate a key because key generate --force fails
18+
echo -e "Generating key"
19+
APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
20+
echo -e "Generated app key: $APP_KEY"
21+
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
22+
23+
ln -s /app/var/.env /app/
1524
fi
1625

1726
## check for DB up before starting the panel
18-
echo "Checking database status."
27+
zshoecho "Checking database status."
1928
until nc -z -v -w30 $DB_HOST 3306
2029

2130
do
@@ -32,7 +41,7 @@ echo -e "Done\n"
3241
## start php-fpm in the background
3342
echo -e "Starting php-fpm in the background. \n"
3443
php-fpm7 -D
35-
echo -e "php-fpm starte.d \n"
44+
echo -e "php-fpm started \n"
3645

3746
## start webserver
3847
echo -e "Starting nginx in the foreground. \n"

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ COPY . ./
99

1010
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
1111
&& cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.conf \
12-
&& echo "APP_ENVIRONMENT_ONLY=false" > /app/.env \
13-
&& echo "APP_KEY=" >> /app/.env \
1412
&& mkdir /var/run/php \
15-
&& composer install --no-dev
13+
&& cp .env.example .env \
14+
&& composer install --no-dev --optimize-autoloader \
15+
&& rm .env
1616

1717
EXPOSE 80 443
1818

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ services:
2323
- cache
2424
volumes:
2525
- "/srv/pterodactyl/var/:/app/var/"
26+
- "/srv/pterodactyl/certs/:/"
2627
environment:
2728
## These are defaults and should be left alone
2829
- "APP_ENV=production"
@@ -34,6 +35,7 @@ services:
3435
- "QUEUE_HIGH=high"
3536
- "QUEUE_STANDARD=standard"
3637
- "QUEUE_LOW=low"
38+
## Cache settings
3739
- "CACHE_DRIVER=redis"
3840
- "SESSION_DRIVER=redis"
3941
- "QUEUE_DRIVER=redis"

0 commit comments

Comments
 (0)