app / Dockerfile
lucianotonet's picture
Update Dockerfile
3a69aae
raw
history blame
1.07 kB
FROM php:8.2-fpm
ARG CACHEBUST=2
RUN echo "Cache bust: $CACHEBUST" > /dev/null
RUN apt-get update && apt-get install -y \
libonig-dev \
libpng-dev \
libxml2-dev \
zip \
unzip \
git \
curl
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /app
RUN --mount=type=secret,id=GITHUB_PAT \
rm -rf /app/* /app/.* || true && \
git clone https://lucianotonet:$(cat /run/secrets/GITHUB_PAT)@github.com/agenciamav/app.agenciamav.com.br.git .
COPY . /app
RUN --mount=type=secret,id=OPENAI_API_KEY \
composer install
RUN php artisan storage:link && \
php artisan config:cache && \
php artisan route:cache && \
php artisan view:cache
RUN chown -R www-data:www-data /app/storage && \
chmod -R 775 /app/storage && \
chown -R www-data:www-data /app/bootstrap/cache && \
chmod -R 775 /app/bootstrap/cache
EXPOSE 7860
COPY start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/start.sh"]