diff --git a/Dockerfile b/Dockerfile index df10086..37a3cd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,9 @@ RUN \ composer install -d /app/grocy --no-dev && \ echo "**** install yarn packages ****" && \ cd /app/grocy && \ - yarn && \ + yarn --production && \ + yarn cache clean && \ + mv /app/grocy/public/node_modules /defaults/node_modules && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ @@ -53,5 +55,5 @@ RUN \ COPY root/ / # ports and volumes -EXPOSE 6781 +EXPOSE 80 VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 98ea027..0934864 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -41,7 +41,9 @@ RUN \ composer install -d /app/grocy --no-dev && \ echo "**** install yarn packages ****" && \ cd /app/grocy && \ - yarn && \ + yarn --production && \ + yarn cache clean && \ + mv /app/grocy/public/node_modules /defaults/node_modules && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ @@ -53,5 +55,5 @@ RUN \ COPY root/ / # ports and volumes -EXPOSE 6781 +EXPOSE 80 VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index a0e3e77..de9aa7f 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -41,7 +41,9 @@ RUN \ composer install -d /app/grocy --no-dev && \ echo "**** install yarn packages ****" && \ cd /app/grocy && \ - yarn && \ + yarn --production && \ + yarn cache clean && \ + mv /app/grocy/public/node_modules /defaults/node_modules && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ @@ -53,5 +55,5 @@ RUN \ COPY root/ / # ports and volumes -EXPOSE 6781 +EXPOSE 80 VOLUME /config diff --git a/README.md b/README.md index 75f617c..b88e216 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ services: environment: - PUID=1000 - PGID=1000 - - TZ= + - TZ=Europe/London volumes: - - :/config + - /path/to/data:/config ports: - 9283:80 restart: unless-stopped @@ -99,9 +99,9 @@ docker run -d \ --name=grocy \ -e PUID=1000 \ -e PGID=1000 \ - -e TZ= \ + -e TZ=Europe/London \ -p 9283:80 \ - -v :/config \ + -v /path/to/data:/config \ --restart unless-stopped \ ghcr.io/linuxserver/grocy ``` @@ -115,7 +115,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-p 80` | will map the container's port 80 to port 9283 on the host | | `-e PUID=1000` | for UserID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation | -| `-e TZ=` | for specifying your timezone | +| `-e TZ=Europe/London` | for specifying your timezone | | `-v /config` | this will store any uploaded data on the docker host | ## Environment variables from files (Docker secrets) @@ -227,7 +227,8 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **08.04.21:** - Update docs to reflect jenkins builder changes +* **10.05.21:** - Reduce image size. +* **08.04.21:** - Update docs to reflect jenkins builder changes. * **17.02.21:** - Rebasing to alpine 3.13. * **26.01.21:** - Add 'ldap' PHP extension. * **22.12.20:** - Add 'ctype' PHP extension. diff --git a/readme-vars.yml b/readme-vars.yml index 84c9675..1a27f59 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -22,10 +22,10 @@ available_architectures: param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - - { vol_path: "/config", vol_host_path: "", desc: "this will store any uploaded data on the docker host" } + - { vol_path: "/config", vol_host_path: "/path/to/data", desc: "this will store any uploaded data on the docker host" } param_usage_include_env: true param_env_vars: - - { env_var: "TZ", env_value: "", desc: "for specifying your timezone" } + - { env_var: "TZ", env_value: "Europe/London", desc: "for specifying your timezone" } param_usage_include_ports: true param_ports: - { external_port: "9283", internal_port: "80", port_desc: "will map the container's port 80 to port 9283 on the host" } @@ -39,7 +39,8 @@ app_setup_block: | # changelog changelogs: - - { date: "08.04.21:", desc: "Update docs to reflect jenkins builder changes" } + - { date: "10.05.21:", desc: "Reduce image size." } + - { date: "08.04.21:", desc: "Update docs to reflect jenkins builder changes." } - { date: "17.02.21:", desc: "Rebasing to alpine 3.13." } - { date: "26.01.21:", desc: "Add 'ldap' PHP extension." } - { date: "22.12.20:", desc: "Add 'ctype' PHP extension." } diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 48593da..5de35ad 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -12,6 +12,9 @@ i=/app/grocy/data mv "$i" /config/"$(basename "$i")" && \ ln -s /config/"$(basename "$i")" "$i" +[[ -d /defaults/node_modules ]] && \ + mv /defaults/node_modules /app/grocy/public/node_modules + # check for config file and copy default if needed [[ ! -f "/config/data/config.php" ]] && \ cp /app/grocy/config-dist.php /config/data/config.php