[add] Composer compileed in multi stagre
This commit is contained in:
parent
18ee0ad333
commit
8b22c0db9c
@ -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
|
FROM ubuntu:16.04
|
||||||
|
|
||||||
# Updating
|
# Updating
|
||||||
@ -21,9 +31,11 @@ ENV APACHE_LOG_DIR /var/log/apache2
|
|||||||
ENV APACHE_LOCK_DIR /var/lock/apache2
|
ENV APACHE_LOCK_DIR /var/lock/apache2
|
||||||
|
|
||||||
WORKDIR /var/www/site
|
WORKDIR /var/www/site
|
||||||
|
COPY . .
|
||||||
|
COPY --from=build-deps /root .
|
||||||
|
|
||||||
COPY composer.json .
|
RUN touch logs/app.log
|
||||||
RUN composer install
|
RUN chmod 777 logs/app.log
|
||||||
|
|
||||||
# Update the default apache site with the config we created.
|
# Update the default apache site with the config we created.
|
||||||
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
|
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
|
||||||
|
@ -5,8 +5,6 @@ services:
|
|||||||
build: api-payroll/
|
build: api-payroll/
|
||||||
ports:
|
ports:
|
||||||
- "8085:80"
|
- "8085:80"
|
||||||
volumes:
|
|
||||||
- ./api-payroll:/var/www/site
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
mysql:
|
mysql:
|
||||||
@ -24,5 +22,4 @@ services:
|
|||||||
MYSQL_USER: 'sloth'
|
MYSQL_USER: 'sloth'
|
||||||
MYSQL_PASS: '12345678'
|
MYSQL_PASS: '12345678'
|
||||||
volumes:
|
volumes:
|
||||||
api-payroll:
|
|
||||||
my-datavolume:
|
my-datavolume:
|
||||||
|
Loading…
Reference in New Issue
Block a user