[add] Composer compileed in multi stagre

This commit is contained in:
Jose Pabl Domingo Aramburo Sanchez 2018-08-12 00:38:39 +00:00
parent 18ee0ad333
commit 8b22c0db9c
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,13 @@
# Stage 1 - the build process
FROM composer:1.7.1 as build-deps
ENV COMPOSER_ALLOW_SUPERUSER 1
WORKDIR /root
COPY composer.json .
RUN composer install
# Stage 2 - the production environment
FROM ubuntu:16.04
# Updating
@ -21,9 +31,11 @@ ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
WORKDIR /var/www/site
COPY . .
COPY --from=build-deps /root .
COPY composer.json .
RUN composer install
RUN touch logs/app.log
RUN chmod 777 logs/app.log
# Update the default apache site with the config we created.
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf

View File

@ -5,8 +5,6 @@ services:
build: api-payroll/
ports:
- "8085:80"
volumes:
- ./api-payroll:/var/www/site
depends_on:
- mysql
mysql:
@ -24,5 +22,4 @@ services:
MYSQL_USER: 'sloth'
MYSQL_PASS: '12345678'
volumes:
api-payroll:
my-datavolume: