mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 13:46:14 +02:00
fully working dockerized grocy
This commit is contained in:
parent
3c172a010b
commit
e1dc9f7b1f
|
|
@ -1,9 +1,10 @@
|
||||||
FROM php:7.0-fpm-alpine
|
FROM php:7.2-fpm-alpine
|
||||||
MAINTAINER Talmai Oliveira <to@talm.ai>
|
MAINTAINER Talmai Oliveira <to@talm.ai>
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
mkdir /www && \
|
apk add --update yarn git &&\
|
||||||
|
mkdir -p /www && \
|
||||||
# Set environments
|
# Set environments
|
||||||
sed -i "s|;*daemonize\s*=\s*yes|daemonize = no|g" /usr/local/etc/php-fpm.conf && \
|
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*127.0.0.1:9000|listen = 9000|g" /usr/local/etc/php-fpm.conf && \
|
||||||
|
|
@ -17,13 +18,38 @@ RUN apk update && \
|
||||||
# sed -i "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" /usr/local/etc/php.ini && \
|
# sed -i "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" /usr/local/etc/php.ini && \
|
||||||
# sed -i "s|;*post_max_size =.*|post_max_size = ${PHP_MAX_POST}|i" /usr/local/etc/php.ini && \
|
# sed -i "s|;*post_max_size =.*|post_max_size = ${PHP_MAX_POST}|i" /usr/local/etc/php.ini && \
|
||||||
# sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" /usr/local/etc/php.ini && \
|
# sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" /usr/local/etc/php.ini && \
|
||||||
|
wget https://raw.githubusercontent.com/composer/getcomposer.org/1b137f8bf6db3e79a38a5bc45324414a6b1f9df2/web/installer -O - -q | php -- --quiet && \
|
||||||
# Cleaning up
|
# Cleaning up
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
COPY info.php /www/
|
COPY public /www/public
|
||||||
|
COPY info.php /www/public
|
||||||
|
COPY controllers /www/controllers
|
||||||
|
COPY data /www/data
|
||||||
|
COPY helpers /www/helpers
|
||||||
|
COPY localization/ /www/localization
|
||||||
|
COPY middleware/ /www/middleware
|
||||||
|
COPY migrations/ /www/migrations
|
||||||
|
COPY publication_assets/ /www/publication_assets
|
||||||
|
COPY services/ /www/services
|
||||||
|
COPY views/ /www/views
|
||||||
|
COPY .yarnrc /www/
|
||||||
|
COPY *.php /www/
|
||||||
|
COPY *.json /www/
|
||||||
|
COPY composer.* /root/.composer/
|
||||||
|
COPY *yarn* /www/
|
||||||
|
COPY *.sh /www/
|
||||||
|
|
||||||
|
# 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 && \
|
||||||
|
chown www-data:www-data -R /www/
|
||||||
|
|
||||||
# Set Workdir
|
# Set Workdir
|
||||||
WORKDIR /www
|
WORKDIR /www/public
|
||||||
|
|
||||||
# Expose volumes
|
# Expose volumes
|
||||||
VOLUME ["/www"]
|
VOLUME ["/www"]
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,13 @@ If, however, your webserver does not support URL rewriting, set `DISABLE_URL_REW
|
||||||
|
|
||||||
## How to run using Docker
|
## How to run using Docker
|
||||||
|
|
||||||
|
The docker images build are based on [Alpine](https://hub.docker.com/_/alpine/), with an extremelly low footprint (less than 10 MB for nginx, and less than 70MB for grocy with php-fm. That number is eventually bumped up to 150MB after all the dependencies are downloaded, however.). Anyhow, to run using docker just do the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
> docker-compose build
|
|
||||||
> docker-compose up
|
> docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
And grocy should be accessible via `http(s)://localhost/`.
|
And grocy should be accessible via `http(s)://localhost/`. The https option will work. However, since the certificate is self-signed, most browsers will complain.
|
||||||
|
|
||||||
## How to update
|
## How to update
|
||||||
Just overwrite everything with the latest release while keeping the `data` directory, check `config-dist.php` for new configuration options and add them to your `data/config.php` (the default from values `config-dist.php` will be used for not in `data/config.php` defined settings). Just to be sure, please empty `data/viewcache`.
|
Just overwrite everything with the latest release while keeping the `data` directory, check `config-dist.php` for new configuration options and add them to your `data/config.php` (the default from values `config-dist.php` will be used for not in `data/config.php` defined settings). Just to be sure, please empty `data/viewcache`.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
root /www; # see: volumes_from
|
root /www/public; # see: volumes_from
|
||||||
|
|
||||||
include /etc/nginx/common.conf;
|
include /etc/nginx/common.conf;
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@ server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
root /www; # see: volumes_from
|
root /www/public; # see: volumes_from
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/certificates/cert.pem;
|
ssl_certificate /etc/nginx/certificates/cert.pem;
|
||||||
ssl_certificate_key /etc/nginx/certificates/key.pem;
|
ssl_certificate_key /etc/nginx/certificates/key.pem;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user