forked from akeneo/pim-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
87 lines (82 loc) · 4.03 KB
/
Dockerfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM mysql:5.7
MAINTAINER [email protected]
WORKDIR /home/akeneo/pim-docs/
ENV DEBIAN_FRONTEND=noninteractive
# Create environment for build with php, python, mysql and composer
RUN apt-get update && \
apt-get install -y --no-install-recommends wget lsb-release apt-transport-https ca-certificates gnupg unzip \
python python-setuptools ssh rsync curl software-properties-common && \
# Add source for php
curl -sL https://packages.sury.org/php/apt.gpg | apt-key add - && \
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list && \
#
# Add sources for nodejs and yarn
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
#
# Add sphinx
wget -O /tmp/sphinx.zip https://github.com/sphinx-doc/sphinx/archive/v1.8.4.zip && \
unzip /tmp/sphinx.zip -d /tmp/ && \
cd /tmp/sphinx-1.8.4/ && \
python setup.py install && \
#
# Add youtube-sphinx extension
wget -O /tmp/sphinxcontrib.youtube.zip \
https://github.com/mickaelandrieu/sphinxcontrib.youtube/archive/master.zip && \
unzip /tmp/sphinxcontrib.youtube.zip -d /tmp/ && \
cd /tmp/sphinxcontrib.youtube-master/ && \
python setup.py install && \
#
# Add sphinx-php extension
wget -O /tmp/sphinx-php.zip \
https://github.com/fabpot/sphinx-php/archive/v1.0.10.zip && \
unzip /tmp/sphinx-php.zip -d /tmp/ && \
cd /tmp/sphinx-php-1.0.10/ && \
python setup.py install && \
#
# Download packages
apt-get update && \
apt-get install -y --no-install-recommends php7.2-apcu php7.2-bcmath \
php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-intl php7.2-mysql php7.2-xml \
php7.2-zip php7.2-mbstring nodejs yarn && \
#
# Configure PHP
echo "memory_limit = 1024M" >> /etc/php/7.2/cli/php.ini && \
echo "date.timezone = Etc/UTC" >> /etc/php/7.2/cli/php.ini && \
#
# Get composer
wget https://getcomposer.org/download/1.6.2/composer.phar -P /home/akeneo/pim-docs/ && \
#
# Clean
apt-get clean && apt-get --yes --quiet autoremove --purge && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /usr/share/doc/* && \
rm -rf /usr/share/man/* && \
rm -rf /usr/share/locale/* && \
rm -rf /var/log/*
COPY build.sh /home/akeneo/pim-docs/build.sh
# Install Akeneo PIM Assets
RUN chmod +x /home/akeneo/pim-docs/build.sh && \
#
# Download curent version
wget https://github.com/akeneo/pim-community-dev/archive/master.zip -P /home/akeneo/pim-docs/ && \
unzip /home/akeneo/pim-docs/master.zip -d /home/akeneo/pim-docs/ && \
#
# Install Akeneo PIM
cd /home/akeneo/pim-docs/pim-community-dev-master/ && \
php -d memory_limit=3G /home/akeneo/pim-docs/composer.phar install --no-dev --no-suggest --ignore-platform-reqs
COPY docker/wait_for_mysql.sh /wait_for_mysql.sh
RUN service mysql start && chmod +x /wait_for_mysql.sh && /wait_for_mysql.sh && \
mysql -u root -e "CREATE DATABASE akeneo_pim" && \
mysql -u root -e "GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost IDENTIFIED BY 'akeneo_pim'" && \
cp /home/akeneo/pim-docs/pim-community-dev-master/app/config/parameters.yml.dist /home/akeneo/pim-docs/pim-community-dev-master/app/config/parameters.yml && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && php bin/console doctrine:schema:create --env=prod && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && php bin/console pim:installer:assets --env=prod && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && sed -i "s#replace: '/bundles'#replace: '../bundles'#" frontend/build/compile-less.js && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && mkdir -p web/css && yarn install && yarn less
#
# Clean
RUN rm -rf /root/.composer/cache && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && ls | grep -v "vendor\|web" | xargs rm -rf