diff --git a/Dockerfile b/Dockerfile index 21bef03..cb7e5ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,11 @@ RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-av RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -COPY . /var/www/html +COPY --chown=www-data:www-data . /var/www/html + +WORKDIR /var/www/html +# Install Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer RUN apt-get update && apt-get install -y \ curl \ @@ -28,5 +32,9 @@ RUN apt-get update && apt-get install -y \ RUN docker-php-ext-install mbstring exif pcntl bcmath gd # Install dependencies +USER www-data RUN composer install +RUN php artisan migrate --force +USER root + COPY --from=assets --chown=www-data:www-data /app /var/www/html diff --git a/docker-compose.production.yaml b/docker-compose.production.yaml index e301e61..b5b4057 100644 --- a/docker-compose.production.yaml +++ b/docker-compose.production.yaml @@ -5,7 +5,7 @@ services: context: . dockerfile: Dockerfile ports: - - "127.0.0.1:8000:8080" + - "127.0.0.1:8000:80" environment: - APP_ENV=production - APP_URL="https://asm.pavo.pw"