-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
139 lines (112 loc) · 4.6 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
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
FROM debian:stable-slim AS base-amd64
LABEL org.opencontainers.image.authors="Jonny Rimkus <jonny@rimkus.it>" \
description="Movim Arm Docker Image based on debian-slim"
SHELL ["/bin/sh", "-c"]
ENV LANG=C.UTF-8
# Install required packages
RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -q \
&& apt-get install -yq --no-install-recommends \
apt-transport-https ca-certificates less nano \
tzdata libatomic1 wget make xz-utils git nginx \
unzip libmagickwand-dev libjpeg-dev libpng-dev libwebp-dev libpq-dev libzip-dev \
composer php-fpm php-curl php-mbstring php-imagick php-gd php-pgsql php-xml php-dev php-pear \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# # Remove MOTD
&& rm -rf /etc/update-motd.d /etc/motd /etc/motd.dynamic \
&& ln -fs /dev/null /run/motd.dynamic
# install php modules
RUN printf "\n" | pecl install imagick zip
# PHP Settings for movim
COPY assets/movim.ini /etc/php/conf.d/movim.ini
RUN ln -s /etc/php/conf.d/movim.ini $(find /etc/php -type d -name mods-available)/movim.ini \
&& phpenmod movim
# PHP FPM Settings
COPY assets/movim-fpm.conf /etc/php/pool.d/movim.conf
RUN rm $(find /etc/php -type d -name pool.d -not -path /etc/php/pool.d)/* \
&& ln -s /etc/php/pool.d/movim.conf $(find /etc/php -type d -name pool.d -not -path /etc/php/pool.d)/movim.conf
# add init script
COPY assets/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# add nginx config
COPY assets/movim-nginx.conf /etc/nginx/sites-available/default
# switch to www-data user
RUN chown -R www-data:www-data /var/www \
&& mkdir -p /usr/local/share/movim \
&& chown www-data:www-data /usr/local/share/movim
USER www-data
WORKDIR /usr/local/share/movim
FROM arm64v8/debian:stable-slim AS base-arm64
LABEL org.opencontainers.image.authors="Jonny Rimkus <jonny@rimkus.it>" \
description="Movim Arm Docker Image based on debian-slim"
SHELL ["/bin/sh", "-c"]
ENV LANG=C.UTF-8
# Install required packages
RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -q \
&& apt-get install -yq --no-install-recommends \
apt-transport-https ca-certificates less nano \
tzdata libatomic1 wget make xz-utils git nginx \
unzip libmagickwand-dev libjpeg-dev libpng-dev libwebp-dev libpq-dev libzip-dev \
composer php-fpm php-curl php-mbstring php-imagick php-gd php-pgsql php-xml php-dev php-pear \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# # Remove MOTD
&& rm -rf /etc/update-motd.d /etc/motd /etc/motd.dynamic \
&& ln -fs /dev/null /run/motd.dynamic
# install php modules
RUN printf "\n" | pecl install imagick zip
# PHP Settings for movim
COPY assets/movim.ini /etc/php/conf.d/movim.ini
RUN ln -s /etc/php/conf.d/movim.ini $(find /etc/php -type d -name mods-available)/movim.ini \
&& phpenmod movim
# PHP FPM Settings
COPY assets/movim-fpm.conf /etc/php/pool.d/movim.conf
RUN rm $(find /etc/php -type d -name pool.d -not -path /etc/php/pool.d)/* \
&& ln -s /etc/php/pool.d/movim.conf $(find /etc/php -type d -name pool.d -not -path /etc/php/pool.d)/movim.conf
# add init script
COPY assets/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# add nginx config
COPY assets/movim-nginx.conf /etc/nginx/sites-available/default
# switch to www-data user
RUN chown -R www-data:www-data /var/www \
&& mkdir -p /usr/local/share/movim \
&& chown www-data:www-data /usr/local/share/movim
USER www-data
WORKDIR /usr/local/share/movim
# install movim arm64
FROM base-arm64 AS movim-arm64
ARG MOVIM_GIT_REPO=/~https://github.com/movim/movim.git
ARG MOVIM_VERSION=v0.28
RUN git clone $MOVIM_GIT_REPO /usr/local/share/movim \
&& cd /usr/local/share/movim \
&& git config --global advice.detachedHead false \
&& git checkout $MOVIM_VERSION \
&& composer install \
&& mkdir -p cache log public/cache
# we need to be root first,
# because the entrypoint.sh starts php-fpm and nginx before
# the movim daemon
USER root
EXPOSE 80 8080
ENTRYPOINT /usr/local/bin/entrypoint.sh
# install movim-amd64
FROM base-amd64 AS movim-amd64
ARG MOVIM_GIT_REPO=/~https://github.com/movim/movim.git
ARG MOVIM_VERSION=v0.28
RUN git clone $MOVIM_GIT_REPO /usr/local/share/movim \
&& cd /usr/local/share/movim \
&& git config --global advice.detachedHead false \
&& git checkout $MOVIM_VERSION \
&& composer install \
&& mkdir -p cache log public/cache
# we need to be root first,
# because the entrypoint.sh starts php-fpm and nginx before
# the movim daemon
USER root
EXPOSE 80 8080
ENTRYPOINT /usr/local/bin/entrypoint.sh