This repository has been archived by the owner on Mar 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-install
141 lines (115 loc) · 3.49 KB
/
Dockerfile-install
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
FROM php:7.3-apache
LABEL maintainer="Deutsches Archäologisches Institut: [email protected]"
LABEL author="Deutsches Archäologisches Institut: [email protected]"
LABEL version="1.0"
LABEL description="DAI specific OMP3 Docker container with DAI specific plugins"
LABEL license="GNU GPL 3"
ENV DEBIAN_FRONTEND noninteractive
ARG MYSQL_USER
ARG MYSQL_PASSWORD
ARG MYSQL_DB
### Install packes needed for installing from custom repos ###
RUN apt-get update && apt-get install -y \
gnupg2 \
software-properties-common \
dirmngr \
wget \
apt-transport-https
### install packages ###
RUN apt-get update && apt-get install -y \
bash-completion \
ca-certificates \
curl \
openssl \
mariadb-server \
acl \
build-essential \
cron \
expect \
git \
libssl-dev \
nano \
supervisor \
unzip \
expect \
libbz2-dev \
libcurl3-dev \
libicu-dev \
libedit-dev \
libxml2-dev \
zlib1g-dev \
libzip-dev
RUN docker-php-ext-install \
bcmath \
bz2 \
curl \
dba \
intl \
json \
mbstring \
mysqli \
pdo \
pdo_mysql \
readline \
xml \
zip
RUN docker-php-ext-enable mysqli
WORKDIR /tmp
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get -y install \
nodejs
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer
### Initialize MySQl database ###
RUN service mysql start && \
echo "CREATE USER '${MYSQL_USER}'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}';" | mysql -u root && \
echo "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User='${MYSQL_USER}'; FLUSH PRIVILEGES;" | mysql -u root && \
echo "CREATE DATABASE ${MYSQL_DB};" | mysql -u root && \
echo "GRANT ALL PRIVILEGES on ${MYSQL_DB}.* TO '${MYSQL_USER}'@'localhost'; FLUSH PRIVILEGES;" | mysql -u root
### Install OMP ###
RUN mkdir -p /var/www/files
COPY omp /var/www/html
WORKDIR /var/www/html
# php modules
RUN composer install -v -d lib/pkp --no-dev
RUN composer install -v -d plugins/paymethod/paypal --no-dev
# js modules
RUN npm install -y
RUN npm run build
# config file
RUN cp config.TEMPLATE.inc.php config.inc.php
RUN sed -i 's/allowProtocolRelative = false/allowProtocolRelative = true/' /var/www/html/lib/pkp/classes/core/PKPRequest.inc.php
# initial file rights
WORKDIR /var
RUN chgrp -f -R www-data www && \
chmod -R 771 www && \
chmod g+s www && \
setfacl -Rm o::x,d:o::x www && \
setfacl -Rm g::rwx,d:g::rwx www
# set file rights (after configuration and installation!)
WORKDIR /var/www
RUN chgrp -f -R www-data html/plugins && \
chmod -R 771 html/plugins && \
chmod g+s html/plugins && \
setfacl -Rm o::x,d:o::x html/plugins && \
setfacl -Rm g::rwx,d:g::rwx html/plugins
RUN chgrp -f -R www-data html/cache && \
chmod -R 771 html/cache && \
chmod g+s html/cache && \
setfacl -Rm o::x,d:o::x html/cache && \
setfacl -Rm g::rwx,d:g::rwx html/cache
RUN chgrp -f -R www-data html/public && \
chmod -R 771 html/public && \
chmod g+s html/public && \
setfacl -Rm o::x,d:o::x html/public && \
setfacl -Rm g::rwx,d:g::rwx html/public
RUN chgrp -f -R www-data files && \
chmod -R 771 files && \
chmod g+s files && \
setfacl -Rm o::x,d:o::x files && \
setfacl -Rm g::rwx,d:g::rwx files
RUN a2enmod rewrite
### go ###
COPY ./docker-entrypoint-install.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint-install.sh"]
EXPOSE 80