-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaptain-definition
40 lines (40 loc) · 1.85 KB
/
captain-definition
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
"schemaVersion": 2,
"dockerfileLines": [
"FROM php:7.2-apache as common",
"# Copy our application",
"COPY . /var/www/html/",
"#Install php extensions",
"RUN docker-php-ext-install pdo_mysql",
"RUN apt-get update -y && apt-get install -y libpng-dev",
"RUN docker-php-ext-install gd",
"#Allow Composer to be run as root",
"#ENV COMPOSER_ALLOW_SUPERUSER 1",
"# Install composer dependencies",
"# Install Composer and make it available in the PATH",
"RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer",
"# In this image we will download the dependencies, but without the development dependencies.",
"# The dependencies are installed in the vendor folder that will be copied later into the prod image.",
"FROM composer as builder-prod",
"WORKDIR /app",
"COPY composer.json composer.lock /app/",
"RUN composer install \\",
" --ignore-platform-reqs \\",
" --no-ansi \\",
" --no-dev \\",
" --no-autoloader \\",
" --no-interaction \\",
" --no-scripts",
"# We need to copy our whole application so that we can generate the autoload file inside the vendor folder.",
"COPY . /app",
"RUN composer dump-autoload --optimize --no-dev --classmap-authoritative",
"# This is the image that will be deployed on production.",
"FROM common as prod",
"# No display errors to users in production.",
"#ENV DISPLAY_ERRORS=\"Off\"",
"# Copy the downloaded dependencies from the builder-prod stage.",
"COPY --from=builder-prod /app/vendor /var/www/html/vendor",
"ADD vhosts.conf /etc/apache2/sites-available/000-default.conf",
"EXPOSE 80"
]
}