Sto cercando di creare un host virtuale nel contenitore php5.6-apache
ma quando provo a eseguire il comando a2ensite.
il mio file host_1:
<VirtualHost *:80>
ServerName local.website1.dev
DocumentRoot /var/www/html/codeigniter_first/public_html/
Options Indexes FollowSymLinks
<Directory "/var/www/html/codeigniter_first/public_html/">
AllowOverride All
<IfVersion < 2.4>
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
il mio file host_2:
<VirtualHost *:80>
ServerName local.website2.dev
DocumentRoot /var/www/html/codeigniter_second/public_html/
Options Indexes FollowSymLinks
<Directory "/var/www/html/codeigniter_second/public_html/">
AllowOverride All
<IfVersion < 2.4>
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
Il mio file Docker:
ARG PHP_VERSION=7.2-apache
FROM php:${PHP_VERSION}
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install pdo pdo_mysql
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
COPY php56.ini /usr/local/etc/php/php.ini
COPY sites/website1.com.conf /etc/apache2/sites-enabled/website1.com.conf
COPY sites/website2.com.conf /etc/apache2/sites-enabled/website2.com.conf
Il mio file compositore Docker:
version: "2"
services:
########################################################
#### PHP and Apache Config
########################################################
www:
build:
context: ./docker-config/php-apache
args:
- PHP_VERSION=5.6-apache
- XDEBUG_REMOTE_HOST=192.168.1.70
container_name: rp-app-workspace
ports:
- "80:80"
volumes:
- "./workdir-apps:/var/www/html/"
- "./docker-config/php-apache/logs:/var/log/apache2"
- "./docker-config/php-apache/sites:/etc/apache2/sites-available"
links:
- db
- memcached
networks:
- default
########################################################
#### Volume Configuration
########################################################
volumes:
persistent:
Quando creo il mio contenitore docker, gli host virtuali non funzionano. quando provo ad aggiungere comandi da eseguire a2ensite
nel file docker mi mostra un errore ERROR: Site website1.com does not exist!
di costruzione
RUN a2ensite website1.com.conf
RUN a2ensite website2.com.conf
Provo anche a cambiare la posizione di copia del file in alto ed eseguo il comando in fondo al file docker.