Skip to content

bbx0/container-grocy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grocy container

docker GitHub

A distribution of Grocy based on the Docker Official Images for PHP.

This is a user contribution to the Grocy Community.

Tags and Variants

The latest Grocy release is continuously built and published as shared tag using a GitHub workflow.

The :latest tag follows the current version. Please see the Grocy releases for a changelog of new versions.

Tag Comment
ghcr.io/bbx0/grocy:latest
ghcr.io/bbx0/grocy:4.5
current
ghcr.io/bbx0/grocy:4.4 EOL, please upgrade
ghcr.io/bbx0/grocy:4.3 EOL, please upgrade

The container images are built multi-platform for: linux/amd64 and linux/arm64.

The EOL tags are built on best-effort basis and will eventually be removed.

Usage

The container requires a /data volume and exposes Grocy on port 8080.

The default login is admin:admin, please change it!

Quick Start

# compose.yaml
# usage: 
#  - docker compose up
#  - docker-compose run --no-TTY --rm app
name: grocy
services:
  app:
    image: bbx0/grocy
    read_only: true
    ports:
      - "127.0.0.1:8080:8080" # Listen on http://127.0.0.1:8080
    environment:
      - GROCY_CURRENCY=EUR    # Set currency to Euro
    volumes:
      - ./data:/data          # The Grocy data directory
# Run a Grocy instance on port 8080 with a /data volume and the currency Euro
docker run --rm --read-only --publish 8080:8080 -e GROCY_CURRENCY=EUR -v ./data:/data bbx0/grocy

# Run an ephemeral Grocy Demo instance on port 8080
docker run --rm --read-only --publish 8080:8080 -e GROCY_MODE=demo bbx0/grocy

Configuration

Configuration is supported using Environment Variables with the prefix GROCY_. Please see config-dist.php for the available options, e.g. use GROCY_CURRENCY=EUR to set the currency to Euro.

Please run the Grocy container behind a reverse proxy for SSL and HTTP configuration.

Example with Caddy as reverse proxy

The following example exposes Grocy at https://grocy.home.arpa:8443 by using Caddy as reverse proxy with a self-signed certificate and a file size limit of 10 MB for uploads.

# Caddyfile

https://grocy.home.arpa {
  request_body {
    max_size 10MB
  }
  encode zstd gzip
  reverse_proxy h2c://app:8080
}
# compose.yml
name: grocy
services:
  app:
    image: bbx0/grocy
    read_only: true
    volumes:
      - grocy_data:/data
    environment:
      - GROCY_CURRENCY=EUR
  reverse-proxy:
    image: caddy:2
    ports:
      - "8443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
volumes:
  grocy_data:
  caddy_data:

Example with a Podman systemd unit (Quadlet)

Run Grocy on 127.0.0.1:8080 as user grocy with a bind mount for the /data volume.

# Create user grocy and allow running services in background
sudo useradd -m grocy
sudo loginctl enable-linger grocy

# Login as user grocy
sudo machinectl shell [email protected]

# As user grocy
mkdir -p ~/.config/containers/systemd
mkdir -p ~/data

cat >.config/containers/systemd/grocy.container <<-'EOF'
[Unit]
Description=Grocy

[Container]
Image=ghcr.io/bbx0/grocy
AutoUpdate=registry
LogDriver=journald
ReadOnly=true

PublishPort=127.0.0.1:8080:8080/tcp
Volume=%h/data:/data

Environment=GROCY_CURRENCY=EUR

[Install]
WantedBy=default.target
EOF

# generate the systemd unit and start Grocy
systemctl --user daemon-reload
systemctl --user start grocy.service

About

Distribution of Grocy based on the Docker Official Images for PHP

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •