Refactor: migrate files
This commit is contained in:
+10
-9
@@ -1,5 +1,5 @@
|
||||
# Base image: PHP 8.2 with Apache
|
||||
FROM php:8.2-apache
|
||||
# Base image: PHP 8.2 with FPM
|
||||
FROM php:8.2-fpm
|
||||
|
||||
# Install necessary system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y \
|
||||
libcurl4-openssl-dev \
|
||||
default-mysql-client \
|
||||
redis-server \
|
||||
nginx \
|
||||
&& docker-php-ext-install \
|
||||
mysqli \
|
||||
pdo \
|
||||
@@ -19,15 +20,15 @@ RUN apt-get update && apt-get install -y \
|
||||
bcmath \
|
||||
sockets
|
||||
|
||||
# Enable Apache mod_rewrite (required for web server routing)
|
||||
RUN a2enmod rewrite
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Copy application code
|
||||
COPY . /var/www/html
|
||||
|
||||
# Copy Nginx configuration file
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Install Composer
|
||||
COPY --from=composer:2.6 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
@@ -37,8 +38,8 @@ RUN composer install --no-dev --optimize-autoloader
|
||||
# Set permissions for the web server
|
||||
RUN chown -R www-data:www-data /var/www/html && chmod -R 755 /var/www/html
|
||||
|
||||
# Expose port 80 for HTTP traffic
|
||||
EXPOSE 80
|
||||
# Expose port 80 (HTTP) and 443 (HTTPS)
|
||||
EXPOSE 80 443
|
||||
|
||||
# Start Redis service when the container starts
|
||||
CMD service redis-server start && apache2-foreground
|
||||
# Start services (Nginx and Redis) when the container starts
|
||||
CMD service redis-server start && nginx -g "daemon off;" && php-fpm
|
||||
Reference in New Issue
Block a user