Docker

Docker installation

Lensfolio can also be set up with a Docker container. The easiest way to do this is to use following code with the apache image.

Docker Image with Apache

To install the apache image, create a folder and download the latest docker-compose.yml.

mkdir lensfolio
cd lensfolio
curl -o docker-compose.yml https://raw.githubusercontent.com/cheinisch/lensfolio/refs/heads/main/docker/docker-compose.yml
docker-compose up -d

The image lensfolio are downloaded. Once set up, the container can be accessed at http://localhost:8080.

If you prefer to do it manually, here is the docker-compose.yml file. You find the latest version at the gitrepo https://github.com/cheinisch/lensfolio.

services:
  imageportfolio:
    image: cheinisch/lensfolio:latest  # Nutze das fertige Image!
    ports:
      - "8080:80"
    volumes:
      - appdata:/var/www/html
      - userdata_volume:/var/www/html/userdata
    environment:
      - TZ=Europe/Berlin
      - PHP_UPLOAD_MAX_FILESIZE=100M
      - PHP_POST_MAX_SIZE=100M

volumes:
  appdata:
  userdata_volume:

Nginx & PHP

If you want to use nginx with php instead of the apache docker image, you need this docker-compose.yml

services:
  php:
    image: cheinisch/lensfolio-php:latest
    expose:
      - "9000"
    volumes:
      - appdata:/var/www/html
      - userdata_volume:/var/www/html/userdata

  nginx:
    image: cheinisch/lensfolio-nginx:latest
    ports:
      - "8080:80"
    depends_on:
      - php
    volumes:
      - appdata:/var/www/html
      - userdata_volume:/var/www/html/userdata

volumes:
  appdata:
  userdata_volume:

The procedure here is also to deploy the containers with docker-compose up -d.

There are two volumes. appdata is for the system and userdata_volume stores the content and settings. If you update the container, your data will be persist.