mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
docker: update to serversideup non priviledged container
This commit is contained in:
parent
8a5a813540
commit
a6eb2f6101
6 changed files with 40 additions and 113 deletions
36
Dockerfile
36
Dockerfile
|
|
@ -1,37 +1,29 @@
|
|||
FROM bnussbau/php:8.3-fpm-opcache-imagick-puppeteer-alpine3.20
|
||||
FROM bnussbau/serversideup-php:8.3-fpm-nginx-alpine-imagick-chromium
|
||||
|
||||
# Install composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
USER www-data
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Copy configuration files
|
||||
COPY docker/nginx.conf /etc/nginx/http.d/default.conf
|
||||
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY docker/php.ini /usr/local/etc/php/conf.d/custom.ini
|
||||
|
||||
# Create required directories
|
||||
RUN mkdir -p /var/log/supervisor \
|
||||
&& mkdir -p storage/logs \
|
||||
RUN mkdir -p storage/logs \
|
||||
&& mkdir -p storage/framework/{cache,sessions,views} \
|
||||
&& chmod -R 775 storage \
|
||||
&& mkdir -p bootstrap/cache \
|
||||
&& chmod -R 775 bootstrap/cache \
|
||||
&& mkdir -p database \
|
||||
&& touch database/database.sqlite \
|
||||
&& chmod -R 777 database
|
||||
&& mkdir -p database
|
||||
|
||||
# Copy application files
|
||||
COPY --chown=www-data:www-data . .
|
||||
COPY --chown=www-data:www-data ./.env.example ./.env
|
||||
|
||||
# Install application dependencies
|
||||
COPY --chown=www-data:www-data composer.json composer.lock ./
|
||||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||
RUN npm ci && npm run build
|
||||
|
||||
COPY --chown=www-data:www-data package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Copy application files
|
||||
COPY --chown=www-data:www-data . .
|
||||
RUN npm run build
|
||||
|
||||
ENV AUTORUN_ENABLED=true
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start supervisor
|
||||
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
EXPOSE 8080
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue