fedi-feed-router/docker/dev/podman/Dockerfile

55 lines
1.4 KiB
Text
Raw Permalink Normal View History

2025-08-02 03:07:27 +02:00
FROM docker.io/library/php:8.4-fpm
2025-08-03 01:34:11 +02:00
# Install system dependencies including nginx
2025-08-02 03:07:27 +02:00
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
nodejs \
npm \
2025-08-03 01:34:11 +02:00
nginx \
2025-08-02 03:07:27 +02:00
default-mysql-client \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd \
2025-08-03 20:59:09 +02:00
&& pecl install redis xdebug \
&& docker-php-ext-enable redis xdebug
2025-08-02 03:07:27 +02:00
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Install Node.js 20.x (for better compatibility)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs
2025-08-03 01:34:11 +02:00
# Copy application code
COPY . .
# Install PHP dependencies in backend
WORKDIR /var/www/html/backend
2025-08-02 03:07:27 +02:00
RUN composer install --optimize-autoloader --no-scripts
2025-08-03 01:34:11 +02:00
# Build React frontend
WORKDIR /var/www/html/frontend
RUN npm install && npm run build
2025-08-02 03:07:27 +02:00
2025-08-03 01:34:11 +02:00
# Back to main directory
WORKDIR /var/www/html
2025-08-02 03:07:27 +02:00
# Set permissions
RUN chown -R www-data:www-data /var/www/html \
2025-08-03 01:34:11 +02:00
&& chmod -R 755 /var/www/html/backend/storage \
&& chmod -R 755 /var/www/html/backend/bootstrap/cache
2025-08-02 03:07:27 +02:00
# Copy and set up container start script
COPY docker/dev/podman/container-start.sh /usr/local/bin/container-start.sh
RUN chmod +x /usr/local/bin/container-start.sh
2025-08-03 01:34:11 +02:00
EXPOSE 80
2025-08-02 03:07:27 +02:00
CMD ["/usr/local/bin/container-start.sh"]