diff --git a/.docker-compose.yml b/.docker-compose.yml index e9e1379..5fec916 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -22,6 +22,7 @@ services: networks: - default volumes: + - env:/var/www/html/env - panel:/var/www/html/pterodactyl - storage:/var/www/html/pterodactyl/storage php: @@ -33,6 +34,7 @@ services: networks: - default volumes: + - env:/var/www/html/env - panel:/var/www/html/pterodactyl - storage:/var/www/html/pterodactyl/storage redis: @@ -46,5 +48,6 @@ networks: volumes: db: + env: panel: storage: diff --git a/services/php/Dockerfile b/services/php/Dockerfile index 4912021..357cb89 100644 --- a/services/php/Dockerfile +++ b/services/php/Dockerfile @@ -18,17 +18,21 @@ RUN docker-php-ext-install xml RUN docker-php-ext-install zip RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -# Set up the server working directory. +# Set up the server working directories. RUN adduser -g '' -D -u 9999 pterodactyl +RUN mkdir -p /var/www/html/env RUN mkdir -p /var/www/html/pterodactyl WORKDIR /var/www/html/pterodactyl -RUN chown -R pterodactyl:pterodactyl /var/www/html/pterodactyl +RUN chown -R pterodactyl:pterodactyl /var/www/html/pterodactyl /var/www/html/env # Deploy panel files. USER pterodactyl:pterodactyl RUN curl -Lo panel.tar.gz https://github.com/Pterodactyl/Panel/releases/download/v0.7.0/panel.tar.gz RUN tar --strip-components=1 -xzvf panel.tar.gz -RUN cp .env.example .env +# Since Docker's configuration mounting feature sucks, we're going to use a cheap +# workaround involving symbolic links. +RUN cp .env.example /var/www/html/env/.env +RUN ln -s /var/www/html/env/.env /var/www/html/pterodactyl/.env RUN composer install --no-dev RUN chmod -R 755 storage/* bootstrap/cache