forked from grocy/grocy-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (33 loc) · 1.26 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
FROM php:8.1.4-fpm-alpine3.15 as grocy-php
ARG GROCY_VERSION
WORKDIR /www
# Install dependencies
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev icu icu-dev && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) \
gd \
intl \
&& \
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Install grocy
RUN curl -L \
"https://github.com/grocy/grocy/releases/download/v${GROCY_VERSION}/grocy_${GROCY_VERSION}.zip" \
-o /tmp/grocy.zip && \
unzip /tmp/grocy.zip && \
rm /tmp/grocy.zip && \
cp config-dist.php data/config.php && \
chmod a+w data
USER 2000:2000
########################################################################################################################
FROM nginx:1.21.6-alpine AS grocy-nginx
WORKDIR /www
COPY nginx.conf /etc/nginx/conf.d/default.conf.template
COPY nginx-entrypoint.sh /usr/local/bin/entrypoint.sh
CMD /usr/local/bin/entrypoint.sh
# Fix permission issues for running as non-root user
RUN chown -R 2000 /etc/nginx/conf.d/ && \
touch /var/run/nginx.pid && \
chown -R 2000 /var/run/nginx.pid && \
chown -R 2000 /var/cache/nginx
COPY --from=grocy-php /www /www
USER 2000:2000