diff --git a/Dockerfile b/Dockerfile index cc2912c..8384447 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,22 @@ COPY ./www . # Remove vendor and node_modules if they exist (to ensure clean install) RUN rm -rf vendor node_modules -# Install composer dependencies during build -RUN composer install --no-interaction --optimize-autoloader --no-dev +# Install composer dependencies +RUN composer install --no-interaction --optimize-autoloader -# Install npm dependencies and build during build +# Copy .env.example to .env +RUN cp .env.example .env + +# Generate application key +RUN php artisan key:generate + +# Install npm dependencies and build RUN npm install && npm run build -# Create storage link during build -RUN php artisan storage:link \ No newline at end of file +# Create storage link +RUN php artisan storage:link + +# Fix permissions for Laravel storage and bootstrap/cache +# Use numeric IDs (1000:1000 from PUID/PGID in docker-compose) +RUN chown -R 1000:1000 /app/www && \ + chmod -R 775 /app/www/storage /app/www/bootstrap/cache \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 943f1cd..1f1b93a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,6 @@ services: - PGID=1000 - TZ=Etc/UTC volumes: - - ./www:/app/www - ./games:/app/www/storage/app/public/games ports: - 8030:80