File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed
Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change 1- FROM php:8.4-apache
1+ FROM unit:php8.4
22
33# Instalar dependencias del sistema y extensiones PHP
44RUN apt-get update && apt-get install -y \
@@ -21,22 +21,32 @@ RUN echo "memory_limit=512M" > /usr/local/etc/php/conf.d/memory.ini \
2121 && echo "post_max_size=256M" >> /usr/local/etc/php/conf.d/memory.ini \
2222 && echo "max_execution_time=300" >> /usr/local/etc/php/conf.d/memory.ini
2323
24- # Habilitar mod_rewrite para Slim
25- RUN a2enmod rewrite
26-
27- # Configurar Apache para Slim
28- RUN echo '<VirtualHost *:8081>\n \
29- DocumentRoot /var/www/html/public\n \
30- <Directory /var/www/html/public>\n \
31- AllowOverride All\n \
32- Require all granted\n \
33- </Directory>\n \
34- </VirtualHost>' > /etc/apache2/sites-available/000-default.conf
35-
3624# Copiar código (incluyendo vendor)
3725COPY . /var/www/html/
3826
27+ WORKDIR /var/www/html
28+
29+ # Crear directorios necesarios y establecer permisos
30+ RUN mkdir -p logs var/cache var/log \
31+ && chown -R unit:unit . \
32+ && chmod -R 755 logs var
33+
34+ # Configuración de Unit para Slim
35+ RUN echo '{\
36+ "listeners": {\
37+ "*:8081": {\
38+ "pass": "applications/slim_app"\
39+ }\
40+ },\
41+ "applications": {\
42+ "slim_app": {\
43+ "type": "php",\
44+ "root": "/var/www/html/public",\
45+ "script": "index.php"\
46+ }\
47+ }\
48+ }' > /docker-entrypoint.d/config.json
3949
4050EXPOSE 8081
4151
42- CMD ["apache2-foreground " ]
52+ CMD ["unitd" , "--no-daemon " ]
You can’t perform that action at this time.
0 commit comments