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

Docs are incorrect for docker-compose/Coolify #20

Open
petergerdes opened this issue Oct 21, 2024 · 1 comment
Open

Docs are incorrect for docker-compose/Coolify #20

petergerdes opened this issue Oct 21, 2024 · 1 comment

Comments

@petergerdes
Copy link

When everything is passed through port 5000 (to use with reverse-proxy (I use Traefik)), the NEXT_PUBLIC_BACKEND_URL is incorrect. It needs to have /api added to it in order to work.

Here is my working example (in Coolify):

  postiz:
    image: 'ghcr.io/gitroomhq/postiz-app:latest'
    container_name: postiz
    restart: always
    environment:
      MAIN_URL: 'https://<your exposed url>/'
      FRONTEND_URL: 'https://<your exposed url>/'
      NEXT_PUBLIC_BACKEND_URL: 'https://<your exposed url>/api'
      JWT_SECRET: <make a secret here>
      DATABASE_URL: 'postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local'
      REDIS_URL: 'redis://postiz-redis:6379'
      BACKEND_INTERNAL_URL: 'http://localhost:3000/'
      IS_GENERAL: 'true'
      STORAGE_PROVIDER: local
      UPLOAD_DIRECTORY: /uploads
      NEXT_PUBLIC_UPLOAD_DIRECTORY: /uploads
    volumes:
      - 'postiz-config:/config/'
      - 'postiz-uploads:/uploads/'
    ports:
      - '5000:5000'
    networks:
      - postiz-network
    labels:
      - traefik.enable=true
      - 'traefik.http.routers.postiz.rule=Host(`<your exposed url>`) && PathPrefix(`/`)'
      - traefik.http.routers.postiz.entryPoints=http
      - traefik.http.routers.postiz.tls=true
      - traefik.http.routers.postiz.tls.certresolver=letsencrypt
      - traefik.http.services.postiz.loadbalancer.server.port=5000
    depends_on:
      postiz-postgres:
        condition: service_healthy
      postiz-redis:
        condition: service_healthy
  postiz-postgres:
    image: 'postgres:14.5'
    container_name: postiz-postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: postiz-password
      POSTGRES_USER: postiz-user
      POSTGRES_DB: postiz-db-local
    volumes:
      - 'postgres-volume:/var/lib/postgresql/data'
    ports:
      - '5432:5432'
    networks:
      - postiz-network
    healthcheck:
      test: 'pg_isready -U postiz-user -d postiz-db-local'
      interval: 10s
      timeout: 3s
      retries: 3
  postiz-redis:
    image: 'redis:7.2'
    container_name: postiz-redis
    restart: always
    ports:
      - '6379:6379'
    healthcheck:
      test: 'redis-cli ping'
      interval: 10s
      timeout: 3s
      retries: 3
    volumes:
      - 'postiz-redis-data:/data'
    networks:
      - postiz-network
volumes:
  postgres-volume:
    external: false
  postiz-redis-data:
    external: false
  postiz-config:
    external: false
networks:
  postiz-network:
    external: false

I have also added Traefik labels in order to get Letsencrypt working.

@jamesread
Copy link
Collaborator

Hey @petergerdes , yep, this is probably OK. Would you like to raise a Pull Request?

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

2 participants