forked from namikingsoft/docker-restyaboard
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
76 lines (69 loc) · 2.29 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
FROM debian:stretch
ENV RESTYABOARD_VERSION=v0.4.2 \
ROOT_DIR=/usr/share/nginx/html \
CONF_FILE=/etc/nginx/conf.d/restyaboard.conf \
SMTP_DOMAIN=localhost \
SMTP_USERNAME=root \
SMTP_PASSWORD=root \
SMTP_SERVER=localhost \
SMTP_PORT=465 \
TZ=Etc/UTC
# update & install package
RUN apt-get update && \
echo "postfix postfix/mailname string localhost" | debconf-set-selections && \
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections && \
TERM=linux DEBIAN_FRONTEND=noninteractive apt-get install -y \
cron \
curl \
imagemagick \
jq \
libpq5 \
nginx \
php7.0 \
php7.0-cli \
php7.0-common \
php7.0-curl \
php7.0-fpm \
php7.0-imagick \
php7.0-imap \
php7.0-ldap \
php7.0-mbstring \
php7.0-pgsql \
php7.0-xml \
postfix \
postgresql-client \
unzip
# deploy app
RUN curl -L -s -o /tmp/restyaboard.zip https://github.com/RestyaPlatform/board/releases/download/${RESTYABOARD_VERSION}/board-${RESTYABOARD_VERSION}.zip && \
unzip /tmp/restyaboard.zip -d ${ROOT_DIR} && \
rm /tmp/restyaboard.zip
# extensions
RUN curl -L -s -o /tmp/apps.json https://raw.githubusercontent.com/RestyaPlatform/board-apps/master/apps.json && \
chmod -R go+w /tmp/apps.json && \
mkdir -p "${ROOT_DIR}/client/apps" && \
for fid in $(jq -r '.[] | .id + "-v" + .version' /tmp/apps.json); \
do \
curl -L -s -G -o /tmp/$fid.zip https://github.com/RestyaPlatform/board-apps/releases/download/v1/$fid.zip; \
file /tmp/$fid.zip | grep Zip && unzip /tmp/$fid.zip -d "${ROOT_DIR}/client/apps"; \
rm /tmp/$fid.zip; \
done && \
rm /tmp/apps.json
# setting app
WORKDIR ${ROOT_DIR}
RUN rm /etc/nginx/sites-enabled/default && \
cp restyaboard.conf ${CONF_FILE} && \
sed -i "s/server_name.*$/server_name \"localhost\";/" ${CONF_FILE} && \
sed -i "s|listen 80.*$|listen 80;|" ${CONF_FILE} && \
sed -i "s|root.*html|root ${ROOT_DIR}|" ${CONF_FILE} && \
chown -R www-data:www-data . && \
chmod -R 777 media && \
chmod -R 777 client/img && \
chmod -R 777 tmp
# cleanup
RUN apt-get autoremove -y --purge && \
apt-get clean
# entrypoint
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["start"]