Files
investbrain/docker/Dockerfile
T

61 lines
1.6 KiB
Docker
Raw Normal View History

2024-12-19 21:10:00 -06:00
FROM php:8.3-fpm
ENV DEBIAN_FRONTEND=noninteractive
# Set the working directory
COPY . /var/www/app
WORKDIR /var/www/app
2024-12-19 21:53:50 -06:00
# Set permissions
RUN chown -R www-data:www-data . \
2025-01-25 20:21:38 -06:00
&& chmod -R 775 ./storage \
2024-12-19 21:53:50 -06:00
&& chmod +x ./docker/entrypoint.sh \
# Install common php extension dependencies
&& apt-get update && apt-get install -y \
2025-01-25 18:09:02 -06:00
nginx \
2024-12-19 21:53:50 -06:00
libfreetype-dev \
libjpeg62-turbo-dev \
libpng-dev \
zlib1g-dev \
libzip-dev \
libicu-dev \
supervisor \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
zip \
pdo_mysql \
mysqli \
intl \
2025-01-25 18:09:02 -06:00
# remove default nginx config
&& rm /etc/nginx/sites-enabled/default
2025-01-25 18:22:12 -06:00
# Install Composer and Node.js
RUN apt-get update && apt-get install -y \
curl \
unzip \
git \
nodejs \
npm \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install PHP dependencies
RUN composer install --no-scripts --optimize-autoloader
# Install Node dependencies and build assets
RUN npm install && npm run build
2025-01-25 20:40:26 -06:00
# Copy over configs
2025-01-25 18:09:02 -06:00
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf
2024-12-19 21:10:00 -06:00
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Serve on port 80
EXPOSE 80
# Set up healthcheck
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -f http://localhost || exit 1
# Run everything else
ENTRYPOINT ["/bin/bash", "./docker/entrypoint.sh"]
CMD ["./docker/entrypoint.sh"]