seperate frontend and backend into different containers
This commit is contained in:
10
backend.dockerfile
Normal file
10
backend.dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM php:7.0-apache
|
||||||
|
|
||||||
|
RUN docker-php-ext-install pdo pdo_mysql mysqli
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
|
COPY docker/php/apache2.conf /etc/apache2/
|
||||||
|
|
||||||
|
COPY backend /var/www/html
|
||||||
|
|
||||||
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
@@ -1,21 +1,29 @@
|
|||||||
version : '2'
|
version : '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: web.dockerfile
|
dockerfile: backend.dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/web/:/var/log/apache2/
|
- ./log/backend/:/var/log/apache2/
|
||||||
ports:
|
ports:
|
||||||
- '8080:80'
|
- '8081:80'
|
||||||
- '8081:443'
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
#use links keywoard to use db as a known host "db" to connect to database
|
#use links keywoard to use db as a known host "db" to connect to database
|
||||||
links:
|
links:
|
||||||
- db
|
- db
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: frontend.dockerfile
|
||||||
|
volumens:
|
||||||
|
- ./log/frontend/:/var/log/apache2/
|
||||||
|
ports:
|
||||||
|
- '8080:80'
|
||||||
|
|
||||||
db:
|
db:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<VirtualHost *:80>
|
|
||||||
# The ServerName directive sets the request scheme, hostname and port that
|
|
||||||
# the server uses to identify itself. This is used when creating
|
|
||||||
# redirection URLs. In the context of virtual hosts, the ServerName
|
|
||||||
# specifies what hostname must appear in the request's Host: header to
|
|
||||||
# match this virtual host. For the default virtual host (this file) this
|
|
||||||
# value is not decisive as it is used as a last resort host regardless.
|
|
||||||
# However, you must set it for any further virtual host explicitly.
|
|
||||||
|
|
||||||
ServerName localhost:8080/api-wiaas
|
|
||||||
|
|
||||||
ServerAdmin webmaster@localhost
|
|
||||||
DocumentRoot /var/www/backend
|
|
||||||
|
|
||||||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
|
||||||
# error, crit, alert, emerg.
|
|
||||||
# It is also possible to configure the loglevel for particular
|
|
||||||
# modules, e.g.
|
|
||||||
#LogLevel info ssl:warn
|
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
||||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
||||||
|
|
||||||
# For most configuration files from conf-available/, which are
|
|
||||||
# enabled or disabled at a global level, it is possible to
|
|
||||||
# include a line for only one particular virtual host. For example the
|
|
||||||
# following line enables the CGI configuration for this host only
|
|
||||||
# after it has been globally disabled with "a2disconf".
|
|
||||||
#Include conf-available/serve-cgi-bin.conf
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<VirtualHost *:80>
|
|
||||||
# The ServerName directive sets the request scheme, hostname and port that
|
|
||||||
# the server uses to identify itself. This is used when creating
|
|
||||||
# redirection URLs. In the context of virtual hosts, the ServerName
|
|
||||||
# specifies what hostname must appear in the request's Host: header to
|
|
||||||
# match this virtual host. For the default virtual host (this file) this
|
|
||||||
# value is not decisive as it is used as a last resort host regardless.
|
|
||||||
# However, you must set it for any further virtual host explicitly.
|
|
||||||
|
|
||||||
ServerName localhost:8080
|
|
||||||
|
|
||||||
ServerAdmin webmaster@localhost
|
|
||||||
DocumentRoot /var/www/html
|
|
||||||
|
|
||||||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
|
||||||
# error, crit, alert, emerg.
|
|
||||||
# It is also possible to configure the loglevel for particular
|
|
||||||
# modules, e.g.
|
|
||||||
#LogLevel info ssl:warn
|
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
||||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
||||||
|
|
||||||
# For most configuration files from conf-available/, which are
|
|
||||||
# enabled or disabled at a global level, it is possible to
|
|
||||||
# include a line for only one particular virtual host. For example the
|
|
||||||
# following line enables the CGI configuration for this host only
|
|
||||||
# after it has been globally disabled with "a2disconf".
|
|
||||||
#Include conf-available/serve-cgi-bin.conf
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|
||||||
@@ -8,15 +8,6 @@ RUN apt-get update && apt-get install -y git unzip gnupg
|
|||||||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
||||||
RUN apt-get install -y nodejs
|
RUN apt-get install -y nodejs
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo pdo_mysql mysqli
|
|
||||||
RUN a2enmod rewrite
|
|
||||||
|
|
||||||
COPY docker/php/apache2.conf /etc/apache2/
|
|
||||||
|
|
||||||
COPY backend /var/www/html
|
|
||||||
|
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
|
||||||
|
|
||||||
COPY frontend /home/wiaas/frontend
|
COPY frontend /home/wiaas/frontend
|
||||||
|
|
||||||
WORKDIR /home/wiaas/frontend
|
WORKDIR /home/wiaas/frontend
|
||||||
Reference in New Issue
Block a user