Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman/Docker compose support for flat-manager #125

Open
toastxc opened this issue Apr 7, 2024 · 5 comments
Open

Podman/Docker compose support for flat-manager #125

toastxc opened this issue Apr 7, 2024 · 5 comments

Comments

@toastxc
Copy link

toastxc commented Apr 7, 2024

I noticed that there is a Dockerfile, but the README describes how to install postgres to the host...

I think there should be an example.container-compose.yml file at least, since its best practice to run databases in a container.

I made an example already however I'm having issues with it.

version: "3.8"
networks:
  flat:

services:
  db:
    image: postgres
    ports:
     - "${POSTGRES_PORTS}"
    volumes:
      - ./db:/data
    env_file:
      - .env
    networks:
      - flat
    environment:
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
      POSTGRES_DB: "${POSTGRES_DB}"

  backend:
    build: .
    ports:
      -  "${REPO_PORTS}"
    command: ["/usr/local/bin/flat-manager"]
    env_file:
      - .env
    depends_on:
      - db
      # restart: always
    networks:
      - flat
    volumes:
        - ./config.json:/config.json
# We want this for the diesel CLI app
DATABASE_URL=postgres://postgres:PSWD@db:5432/repo
# config file location
REPO_CONFIG=/config.json

POSTGRES_PASSWORD=PSWD
POSTGRES_PORTS=5432:5432
POSTGRES_DB="repo"




REPO_PORTS=8082:8082
@toastxc
Copy link
Author

toastxc commented Apr 10, 2024

I managed to get passed the config file issue for compose, but this reverse proxy is giving me grief.

@toastxc
Copy link
Author

toastxc commented Apr 10, 2024

...how do people use this server? I don't understand why theres no information on reverse proxying or containers

@nalsai
Copy link
Contributor

nalsai commented May 23, 2024

I use flatman with traefik as a reverse proxy. Here is my docker-compose file:

version: "3.9"

services:
  flat-manager:
    image: ghcr.io/flatpak/flat-manager:13841c5a6667d6ab9d0849523c9e49ad5f34dda8  
    restart: unless-stopped
    volumes:
      - ./flatman:/flat-manager
    depends_on:
      - "db"
    #ports:
      #- 8080:8080
    networks:
      - internal
      - traefik
    environment:
      HOME: /flat-manager
      REPO_CONFIG: /flat-manager/config.json
      RUST_LOG: info #error
      #RUST_BACKTRACE: full
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.flatpak.rule=Host(`flatpak.hachiman.nils.moe`, `flatpak.nils.moe`)"
      - "traefik.http.routers.flatpak.entrypoints=websecure"
      - "traefik.http.routers.flatpak.tls.certresolver=letsencrypt"
      - "traefik.http.services.flatpak.loadbalancer.server.port=8080"

  db:
    image: postgres:14-alpine
    restart: unless-stopped
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: repo
      POSTGRES_USER: flatmanager
      POSTGRES_PASSWORD: PASSWORD
    networks:
      - internal

networks:
  traefik:
    external: true
  internal:

And this is my flatman config:

{
    "repos": {
        "": {
            "path": "/flat-manager/repo",
            "collection-id": "moe.nils.flatpak",
            "suggested-repo-name": "nalsai",
            "runtime-repo-url": "https://dl.flathub.org/repo/flathub.flatpakrepo",
            "gpg-key": "7E56B236E04AD5F0",
            "base-url": "https://flatpak.nils.moe/repo",
            "subsets": {
                "all": {
                    "collection-id": "moe.nils.flatpak",
                    "base-url": null
                }
            }
        }
    },
    "base-url": "https://flatpak.nils.moe",
    "host": "0.0.0.0",
    "port": 8080,
    "delay-update-secs": 10,
    "database-url": "postgres://flatmanager:PASSWORD@db:5432/repo",
    "build-repo-base": "/flat-manager/build-repo",
    "build-gpg-key": "7E56B236E04AD5F0",
    "gpg-homedir": "/flat-manager/gpg",
    "secret": "SECRET"
}

@ranisalt
Copy link

@nalsai did you manually add the .flatpakrepo file to your repo? (assuming you're talking about https://github.com/nalsai/MyFlatpaks)

My instance of flat-manager generates no files like that whatsoever and I wonder why

@nalsai
Copy link
Contributor

nalsai commented Oct 23, 2024

Yes, I manually added the flatpakrepo and flatpakref files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants