Browse Source

Config apache

main
lucas cardoso 2 years ago
parent
commit
e5a5176eb3
  1. 20
      Dockerfile
  2. 0
      apache/.htaccess
  3. 3
      apache/.htaccess_public
  4. 2
      apache/apache2.conf
  5. 17
      apache/revers_proxy.conf
  6. 8
      supervisord.conf

20
Dockerfile

@ -1,27 +1,31 @@
FROM php:8.1.7-apache FROM php:8.1.7-apache
### Install surpervisor ###
RUN apt-get update -y RUN apt-get update -y
RUN apt-get install -y supervisor unzip git vim RUN apt-get install -y supervisor unzip vim
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN HASH=`curl -sS https://composer.github.io/installer.sig` RUN HASH=`curl -sS https://composer.github.io/installer.sig`
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN mkdir /var/www/public
#config supervisord
RUN mkdir -p /var/www/html/ /var/log/supervisor RUN mkdir -p /var/www/html/ /var/log/supervisor
COPY supervisord.conf /etc/supervisor/supervisord.conf COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY apache2.conf /etc/apache2/apache2.conf #config apache
COPY .htaccess /var/www/ COPY apache/apache2.conf /etc/apache2/apache2.conf
COPY apache/revers_proxy.conf /etc/apache2/conf-available/revers_proxy.conf
COPY apache/.htaccess /var/www/public/
COPY apache/.htaccess_public /var/www/
RUN a2enconf revers_proxy
RUN a2enmod rewrite RUN a2enmod rewrite
RUN a2enmod actions RUN a2enmod actions
## CONFIGURANDO AMBIENTE WEB ## RUN a2enmod proxy proxy_http
#config composer
WORKDIR /var/www/public WORKDIR /var/www/public
RUN git config --global user.email "desenvolvimento@simplesip.com.br"
RUN git config --global user.name "Desenvolvimento"
COPY . /var/www/public COPY . /var/www/public
RUN rm -rf composer.lock RUN rm -rf composer.lock
RUN rm -rf vendor RUN rm -rf vendor
RUN composer install RUN composer install
EXPOSE 80 EXPOSE 80
#CMD supervisord -n -c /etc/supervisor/supervisord.conf CMD supervisord -n -c /etc/supervisor/supervisord.conf
#CMD [ "/usr/sbin/httpd", "-D", "FOREGROUND" ] #CMD [ "/usr/sbin/httpd", "-D", "FOREGROUND" ]

0
.htaccess → apache/.htaccess

3
apache/.htaccess_public

@ -0,0 +1,3 @@
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]

2
apache2.conf → apache/apache2.conf

@ -224,4 +224,4 @@ IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations: # Include the virtual host configurations:
# IncludeOptional sites-enabled/*.conf # IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

17
apache/revers_proxy.conf

@ -0,0 +1,17 @@
<IfModule mod_proxy.c>
ProxyRequests On
<Proxy *>
Require all granted
</Proxy>
ProxyVia On
<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot "/var/cache/mod_proxy"
</IfModule>
ProxyPass /wss ws://127.0.0.1:8080/ws
ProxyPassReverse /wss wss://127.0.0.1:8080/ws
</IfModule>

8
supervisord.conf

@ -1,13 +1,11 @@
[supervisord] [supervisord]
nodaemon=true nodaemon=true
user=root
[program:apache2] [program:apache2]
command=service apache2 start command=apache2-foreground
redirect_stderr=true
[program:test_services] [program:test_services]
command=php /var/www/tests/test_services.php command=php /var/www/public/tests/test_services.php
[program:websocket] [program:websocket]
command=php /var/www/websocket/websocket.php command=php /var/www/public/websocket/websocket.php
Loading…
Cancel
Save