-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
88 lines (78 loc) · 2.39 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
FROM php:8.2-fpm-alpine
#
# flarum production config
#
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
COMPOSER_ALLOW_SUPERUSER=1
RUN \
# China mainland mirrors
# sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
# && echo "Asia/Shanghai" > /etc/timezone && \
# php extensions
apk add \
freetype \
freetype-dev \
libpng \
libpng-dev \
gmp-dev \
oniguruma-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
patch \
supervisor \
$PHPIZE_DEPS \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd gmp pdo_mysql exif opcache \
# complier & shadow & rsync & redis & nginx
&& apk add autoconf automake make gcc g++ libtool pkgconfig shadow rsync redis nginx \
# APCu
&& pecl install apcu \
&& docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini \
# composer
&& curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
# clean
&& apk del autoconf automake make gcc g++ libtool pkgconfig shadow \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
$PHPIZE_DEPS \
&& rm /var/cache/apk/* \
# nginx log
&& mkdir -p /data/log/nginx \
&& chown -R nginx:nginx /data/log/nginx
# php config
ADD ./build/app/custom-php.ini "$PHP_INI_DIR/conf.d/"
ADD ./build/app/opcache.ini "$PHP_INI_DIR/conf.d/"
# nginx
ADD ./build/nginx/nginx.conf /etc/nginx/
ADD ./build/nginx/snippets /etc/nginx/snippets
ADD ./build/nginx/sites /etc/nginx/sites
# redis
COPY ./build/redis/redis.conf /etc/redis/redis.conf
# start up script
COPY ./build/supervisor/supervisor.conf /etc/supervisor.conf
COPY ./build/app/start-app.sh /
COPY ./build/nginx/start-nginx.sh /
COPY ./build/redis/start-redis.sh /
# add flarum-0x
ADD . /var/www/flarum
WORKDIR /var/www/flarum
RUN \
# install deps
composer i --ignore-platform-reqs && \
rm -rf /root/.composer && \
chown -R www-data:www-data /var/www/flarum && \
# flarum custom config
ln -s /data/flarum/config.php config.php && \
rm -rf public/assets && \
ln -s /data/flarum/assets public/assets
# custom storage path
ADD ./build/app/site.php /var/www/flarum
# volume
VOLUME [ "/data" ]
# entry point
ENTRYPOINT []
CMD supervisord -c /etc/supervisor.conf