mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Improved Dockerfile
This commit is contained in:
parent
f126d87a09
commit
fb115fe920
1 changed files with 13 additions and 13 deletions
26
Dockerfile
26
Dockerfile
|
@ -1,12 +1,9 @@
|
||||||
FROM php:7-apache
|
FROM php:7-apache
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl libcurl4-openssl-dev libicu-dev libpng-dev gnupg zip libzip-dev libonig-dev libxslt-dev
|
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/*
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo_mysql curl intl mbstring bcmath gd zip xml xsl
|
RUN docker-php-ext-install pdo_mysql curl intl mbstring bcmath gd zip xml xsl
|
||||||
|
|
||||||
# Install composer
|
|
||||||
#RUN curl --silent --show-error https://getcomposer.org/installer | php
|
|
||||||
|
|
||||||
# Install yarn
|
# Install yarn
|
||||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
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 echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
@ -15,21 +12,24 @@ RUN apt-get update && apt-get install -y yarn
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
COPY . .
|
COPY --chown=www-data:www-data . .
|
||||||
|
|
||||||
# Setup apache2
|
# Setup apache2
|
||||||
RUN a2dissite 000-default.conf
|
RUN a2dissite 000-default.conf
|
||||||
COPY ./.docker/symfony.conf /etc/apache2/sites-available/symfony.conf
|
COPY ./.docker/symfony.conf /etc/apache2/sites-available/symfony.conf
|
||||||
RUN a2ensite symfony.conf
|
RUN a2ensite symfony.conf
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
# Use demo env to output logs to stdout
|
||||||
ENV APP_ENV=demo
|
ENV APP_ENV=demo
|
||||||
|
ENV DATABASE_URL="sqlite:///%kernel.project_dir%/uploads/app.db"
|
||||||
|
|
||||||
RUN composer install -a --no-dev
|
USER root
|
||||||
RUN yarn install && yarn build
|
|
||||||
RUN php bin/console ckeditor:install --clear=skip
|
|
||||||
|
|
||||||
RUN php bin/console cache:warmup
|
|
||||||
|
|
||||||
# Clean up composer cache
|
|
||||||
RUN rm -rf /root/.composer
|
|
||||||
|
|
||||||
|
VOLUME ["/var/www/html/uploads", "/var/www/html/public/media"]
|
||||||
|
EXPOSE 80
|
Loading…
Add table
Add a link
Reference in a new issue