2019-11-17 19:07:07 +01:00
|
|
|
FROM php:7-apache
|
|
|
|
|
2021-03-14 22:12:55 +01:00
|
|
|
RUN apt-get update && apt-get install -y curl libcurl4-openssl-dev libicu-dev libpng-dev gnupg zip libzip-dev libonig-dev libxslt-dev && rm -rf /var/lib/apt/lists/*
|
2019-11-17 19:07:07 +01:00
|
|
|
|
2019-12-01 15:44:32 +01:00
|
|
|
RUN docker-php-ext-install pdo_mysql curl intl mbstring bcmath gd zip xml xsl
|
2019-11-17 19:07:07 +01:00
|
|
|
|
|
|
|
# Install yarn
|
|
|
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
|
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
|
|
|
RUN apt-get update && apt-get install -y yarn
|
|
|
|
|
|
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
|
|
|
|
WORKDIR /var/www/html
|
2021-03-14 22:12:55 +01:00
|
|
|
COPY --chown=www-data:www-data . .
|
2019-11-17 19:07:07 +01:00
|
|
|
|
|
|
|
# Setup apache2
|
|
|
|
RUN a2dissite 000-default.conf
|
|
|
|
COPY ./.docker/symfony.conf /etc/apache2/sites-available/symfony.conf
|
|
|
|
RUN a2ensite symfony.conf
|
2021-03-14 22:12:55 +01:00
|
|
|
RUN a2enmod rewrite
|
2019-11-17 19:07:07 +01:00
|
|
|
|
2021-03-14 22:12:55 +01:00
|
|
|
USER www-data
|
|
|
|
RUN composer install -a --no-dev && composer clear-cache
|
|
|
|
RUN yarn install && yarn build && yarn cache clean
|
|
|
|
RUN php bin/console --env=prod ckeditor:install --clear=skip
|
2019-11-17 19:07:07 +01:00
|
|
|
|
2021-03-14 22:12:55 +01:00
|
|
|
# Use demo env to output logs to stdout
|
|
|
|
ENV APP_ENV=demo
|
|
|
|
ENV DATABASE_URL="sqlite:///%kernel.project_dir%/uploads/app.db"
|
2019-11-17 19:07:07 +01:00
|
|
|
|
2021-03-14 22:12:55 +01:00
|
|
|
USER root
|
2019-11-17 19:07:07 +01:00
|
|
|
|
2021-03-14 22:12:55 +01:00
|
|
|
VOLUME ["/var/www/html/uploads", "/var/www/html/public/media"]
|
|
|
|
EXPOSE 80
|