|
1 | 1 | FROM php:7.3-apache |
2 | | -RUN apt-get update && \ |
3 | | - apt-get install -y \ |
| 2 | + |
| 3 | +# ============================================================================== |
| 4 | +# Set up the machine |
| 5 | +# ------------------------------------------------------------------------------ |
| 6 | +COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer |
| 7 | + |
| 8 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 9 | + |
| 10 | +RUN export DEBIAN_FRONTEND=noninteractive \ |
| 11 | + && apt-get update && \ |
| 12 | + apt-get install -y --no-install-recommends \ |
4 | 13 | git \ |
5 | 14 | libzip-dev \ |
6 | | - zlib1g-dev |
7 | | -WORKDIR /tls |
8 | | -RUN openssl req -new -x509 -days 365 -nodes \ |
9 | | - -out server.cert \ |
10 | | - -keyout server.key \ |
11 | | - -subj "/C=RO/ST=Bucharest/L=Bucharest/O=IT/CN=www.example.ro" |
12 | | -RUN docker-php-ext-install mysqli pdo pdo_mysql zip mbstring bcmath |
13 | | -RUN a2enmod rewrite |
14 | | -RUN a2enmod ssl |
15 | | -RUN a2enmod headers |
16 | | -WORKDIR /install |
17 | | -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" |
18 | | -RUN php composer-setup.php |
19 | | -RUN php -r "unlink('composer-setup.php');" |
20 | | -ADD . /app |
21 | | -WORKDIR /app |
22 | | -RUN php /install/composer.phar require lcobucci/jwt:3.3.3 |
23 | | -RUN php /install/composer.phar update |
24 | | -RUN php /install/composer.phar install |
| 15 | + zlib1g-dev \ |
| 16 | + && rm -rf /var/lib/apt/lists/* |
| 17 | + |
| 18 | +RUN mkdir /tls && openssl req -new -x509 -days 365 -nodes \ |
| 19 | + -out /tls/server.cert \ |
| 20 | + -keyout /tls/server.key \ |
| 21 | + -subj "/C=NL/ST=Overijssel/L=Enschede/O=PDS Interop/OU=IT/CN=pdsinterop.org" |
| 22 | + |
| 23 | +RUN docker-php-ext-install \ |
| 24 | + bcmath \ |
| 25 | + mbstring \ |
| 26 | + mysqli \ |
| 27 | + pdo \ |
| 28 | + pdo_mysql \ |
| 29 | + zip |
| 30 | + |
| 31 | +RUN a2enmod headers rewrite ssl |
| 32 | + |
25 | 33 | COPY site.conf /etc/apache2/sites-enabled/site.conf |
26 | | -RUN chown -R www-data:www-data /app |
| 34 | + |
| 35 | +WORKDIR /app |
| 36 | + |
27 | 37 | EXPOSE 443 |
| 38 | +# ============================================================================== |
| 39 | + |
| 40 | + |
| 41 | +# ============================================================================== |
| 42 | +# Add the source code |
| 43 | +# ------------------------------------------------------------------------------ |
| 44 | +ARG PROJECT_PATH |
| 45 | +RUN : "${PROJECT_PATH:=$PWD}" |
| 46 | + |
| 47 | +COPY "${PROJECT_PATH}" /app/ |
| 48 | + |
| 49 | +RUN composer install --no-dev --prefer-dist |
| 50 | +RUN chown -R www-data:www-data /app |
| 51 | +# ============================================================================== |
0 commit comments