-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 734 Bytes
/
Dockerfile
File metadata and controls
30 lines (20 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM php:8.2-apache
# Enable required PHP extensions
RUN docker-php-ext-install mysqli pdo_mysql
# Enable mod_rewrite
RUN a2enmod rewrite
# Set default ServerName to suppress notice
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Configure Apache to listen on port 8080
RUN sed -i 's/80/8080/' /etc/apache2/ports.conf
RUN sed -i 's/:80>/:8080>/' /etc/apache2/sites-available/000-default.conf
# Copy your app
COPY . /var/www/html/
# Allow .htaccess overrides
RUN sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# Set permissions for Apache
RUN chown -R www-data:www-data /var/www/html
# Expose Railway default port
EXPOSE 8080
# Start Apache in foreground
CMD ["apache2-foreground"]