forked from grocy/grocy-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-grocy
64 lines (58 loc) · 2.39 KB
/
Dockerfile-grocy
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
FROM php:7.2-fpm-alpine
LABEL maintainer="Talmai Oliveira <[email protected]>"
RUN apk update && \
apk upgrade && \
apk add --no-cache --update yarn git python py-pip wget freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
docker-php-ext-install -j${NPROC} gd && \
mkdir -p /www && \
# Set environments
sed -i "s|;*daemonize\s*=\s*yes|daemonize = no|g" /usr/local/etc/php-fpm.conf && \
sed -i "s|;*listen\s*=\s*127.0.0.1:9000|listen = 9000|g" /usr/local/etc/php-fpm.conf && \
sed -i "s|;*listen\s*=\s*/||g" /usr/local/etc/php-fpm.conf && \
sed -i "s|;*chdir\s*=\s*/var/www|chdir = /www|g" /usr/local/etc/php-fpm.d/www.conf && \
wget https://getcomposer.org/installer -O - -q | php -- --quiet && \
pip install lastversion==0.2.4 && \
mkdir -p /tmp/download && \
wget -t 3 -T 30 -nv -O "grocy.tar.gz" $(lastversion --source grocy/grocy) && \
tar xzf grocy.tar.gz && \
rm -f grocy.tar.gz && \
cd grocy-* && \
mv public /www/public && \
mv controllers /www/controllers && \
mv data /www/data && \
mv helpers /www/helpers && \
mv localization/ /www/localization && \
mv middleware/ /www/middleware && \
mv migrations/ /www/migrations && \
mv publication_assets/ /www/publication_assets && \
mv services/ /www/services && \
mv views/ /www/views && \
mv .yarnrc /www/ && \
mv *.php /www/ && \
mv *.json /www/ && \
mv composer.* /root/.composer/ && \
mv *yarn* /www/ && \
mv *.sh /www/ && \
# Cleaning up
rm -rf /tmp/download && \
rm -rf /var/cache/apk/*
# run php composer.phar with -vvv for extra debug information
RUN cd /var/www/html && \
php composer.phar --working-dir=/www/ -n install && \
cp /www/config-dist.php /www/data/config.php && \
cd /www && \
yarn install && \
mkdir /www/data/viewcache && \
chown www-data:www-data -R /www/
# Set Workdir
WORKDIR /www/public
# Expose volumes
VOLUME ["/www"]
# Expose ports
EXPOSE 9000