laravel
Browse files- Dockerfile +1 -62
Dockerfile
CHANGED
@@ -51,65 +51,4 @@ RUN mkdir -p /var/www/html/storage \
|
|
51 |
EXPOSE 7860
|
52 |
|
53 |
# Start Apache
|
54 |
-
CMD ["apache2-foreground"]
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
# Use the official PHP image
|
60 |
-
FROM php:8.2-apache
|
61 |
-
|
62 |
-
# Install necessary packages and PHP extensions
|
63 |
-
RUN apt-get update && apt-get install -y \
|
64 |
-
wget \
|
65 |
-
git \
|
66 |
-
gnupg \
|
67 |
-
lsb-release \
|
68 |
-
apt-transport-https \
|
69 |
-
ca-certificates \
|
70 |
-
libpq-dev \
|
71 |
-
libsqlite3-dev \
|
72 |
-
zip \
|
73 |
-
unzip \
|
74 |
-
&& docker-php-ext-install pgsql pdo_pgsql pdo_sqlite mysqli pdo_mysql
|
75 |
-
|
76 |
-
# Install Composer
|
77 |
-
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
78 |
-
|
79 |
-
# Copy the Laravel project into the container
|
80 |
-
COPY ./php/ /var/www/html
|
81 |
-
|
82 |
-
# Run composer install to install dependencies, ignoring platform requirements and disabling scripts
|
83 |
-
RUN composer install --working-dir=/var/www/html --ignore-platform-reqs --no-scripts
|
84 |
-
|
85 |
-
# Set Apache DocumentRoot to Laravel's public directory
|
86 |
-
RUN sed -i 's|/var/www/html|/var/www/html/public|' /etc/apache2/sites-available/000-default.conf
|
87 |
-
|
88 |
-
# Change Apache to listen on port 7860
|
89 |
-
RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf \
|
90 |
-
&& sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
|
91 |
-
|
92 |
-
# Set correct permissions for directories
|
93 |
-
RUN chown -R www-data:www-data /var/www/html \
|
94 |
-
&& find /var/www/html -type d -exec chmod 755 {} \; \
|
95 |
-
&& find /var/www/html -type f -exec chmod 644 {} \;
|
96 |
-
|
97 |
-
# Ensure the SQLite database file and directory have the correct permissions
|
98 |
-
RUN mkdir -p /var/www/html/storage \
|
99 |
-
&& mkdir -p /var/www/html/bootstrap/cache \
|
100 |
-
&& chown -R www-data:www-data /var/www/html/storage \
|
101 |
-
&& chown -R www-data:www-data /var/www/html/bootstrap/cache \
|
102 |
-
&& chmod -R 775 /var/www/html/storage \
|
103 |
-
&& chmod -R 775 /var/www/html/bootstrap/cache
|
104 |
-
|
105 |
-
# Set environment variables
|
106 |
-
ENV PMA_HOST=mysql-7364790-localbugtv.l.aivencloud.com
|
107 |
-
ENV PMA_PORT=10490
|
108 |
-
ENV MYSQL_ROOT_PASSWORD=root
|
109 |
-
ENV APACHE_PORT=7860
|
110 |
-
|
111 |
-
# Expose the Apache port
|
112 |
-
EXPOSE 7860
|
113 |
-
|
114 |
-
# Start Apache
|
115 |
-
CMD ["apache2-foreground"]
|
|
|
51 |
EXPOSE 7860
|
52 |
|
53 |
# Start Apache
|
54 |
+
CMD ["apache2-foreground"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|