LinkStackOrg / linkstack-docker

A simple to set up docker variant of LinkStack. LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface.
https://linkstack.org/docker
GNU Affero General Public License v3.0
340 stars 41 forks source link

Adding docker-compose setup #18

Closed eiabea closed 1 year ago

eiabea commented 1 year ago

I noticed that the README.md only contains documentation about who to run this project as plain docker container. I would love to see a section with an example docker-compose.yml file

JulianPrieber commented 1 year ago

I have absolutely no experience working with docker compose. I'm currently not able to test this, but something like this might work:

docker:
  littlelink-custom:
    image: julianprieber/littlelink-custom
    container_name: littlelink-custom
    hostname: littlelink-custom
    restart: unless-stopped
    ports:
     - "80:80"
     - "443:443"
    volumes:
     - llc:/htdocs
    environment:
     - HTTP_SERVER_NAME=www.example.xyz
     - HTTPS_SERVER_NAME=www.example.xyz
     - SERVER_ADMIN=admin@example.xyz
     - TZ=Europe/Berlin
     - PHP_MEMORY_LIMIT=512M
     - UPLOAD_MAX_FILESIZE=16M

volumes:
  llc:
STaRDoGG commented 1 year ago

Here's mine. If you don't use Docker Swarm you can leave out the deploy section.

version: "3.8"

services:

  littlelink-custom:
    hostname: 'littlelink-custom'
    image: 'julianprieber/littlelink-custom:latest'
    environment:
      TZ: 'America/Chicago'
      SERVER_ADMIN: youremail@gmail.com'
      HTTP_SERVER_NAME: 'yourdomain.com''
      HTTPS_SERVER_NAME: 'yourdomain.com'
      LOG_LEVEL: 'info'
      PHP_MEMORY_LIMIT: '256M'
      UPLOAD_MAX_FILESIZE: '2M'
    volumes:
      - '/opt/docker/configs/littlelink/config/.env:/htdocs/.env:rw'
      - '/opt/docker/configs/littlelink/config/advanced-config.php:/htdocs/config/advanced-config.php:rw'
      - '/opt/docker/configs/littlelink/config/img:/htdocs/img:rw'
    ports:
      - '8088:80'
      - '8090:443'
    deploy:
      mode: 'replicated'
      replicas: 1
      placement:
        constraints:
          - 'node.labels.Main == true'
      resources:
        limits:
          memory: '220M'
      restart_policy:
        condition: 'any'
    networks:
      - 'mariadb'
      - 'misc'
      - 'redis'

networks:
  misc:
    external: true
    name: 'misc'
  mariadb:
    external: true
    name: 'db-mariadb'
  redis:
    external: true
    name: 'db-redis'
eiabea commented 1 year ago

@STaRDoGG LGTM, thank you! @JulianPrieber I think this would be an awesome addition to the README.md