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

Has anybody been able to actually run this? #2018

Open
OddSquirrel opened this issue Aug 16, 2024 · 6 comments
Open

Has anybody been able to actually run this? #2018

OddSquirrel opened this issue Aug 16, 2024 · 6 comments

Comments

@OddSquirrel
Copy link

Hi there,

so, I'm not a real Docker pro, but so far I've managed to spin up 15 stacks that ran beautiful right from the start or required minimal meddling with ports if already taken by another container. But, honestly, this is the most convoluted installation process I've come across over the years.

It kind of starts with "The platform is extremely user-friendly and can be self-hosted in less than 30 seconds" after which you need to search high and low for the compose file in the first place.

And, for whatever reason, the author elected to choose a port for minio that is already in use by anybody running Portainer, which should be many, so ports need changing. I also run another browserless image for changedetection.io, so both ports needed to be switched over. This is the compose file I ended up with:

version: "3.8"

# In this Docker Compose example, it assumes that you maintain a reverse proxy externally (or chose not to).
# The only two exposed ports here are from minio (:9000) and the app itself (:3000).
# If these ports are changed, ensure that the env vars passed to the app are also changed accordingly.

services:
  # Database (Postgres)
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Storage (for image uploads)
  minio:
    image: minio/minio
    restart: unless-stopped
    command: server /data --address :"3003"
    ports:
      - "3003:9000"
    volumes:
      - minio_data:/data
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin

  # Chrome Browser (for printing and previews)
  chrome:
    image: ghcr.io/browserless/chromium:latest
    restart: unless-stopped
    environment:
      TIMEOUT: 10000
      CONCURRENT: 10
      TOKEN: chrome_token
      EXIT_ON_HEALTH_FAILURE: true
      PRE_REQUEST_HEALTH_CHECK: true

  app:
    image: amruthpillai/reactive-resume:latest
    restart: unless-stopped
    ports:
      - "3002:3000"
    depends_on:
      - postgres
      - minio
      - chrome
    environment:
      # -- Environment Variables --
      PORT: 3002
      NODE_ENV: production

      # -- URLs --
      PUBLIC_URL: http://127.0.0.1:3002
      STORAGE_URL: http://127.0.0.1:3003/default

      # -- Printer (Chrome) --
      CHROME_TOKEN: chrome_token
      CHROME_URL: ws://chrome:3002

      # -- Database (Postgres) --
      DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres

      # -- Auth --
      ACCESS_TOKEN_SECRET: access_token_secret
      REFRESH_TOKEN_SECRET: refresh_token_secret

      # -- Emails --
      MAIL_FROM: noreply@localhost
      # SMTP_URL: smtp://user:pass@smtp:587 # Optional

      # -- Storage (Minio) --
      STORAGE_ENDPOINT: minio
      STORAGE_PORT: 3003
      STORAGE_REGION: us-east-1 # Optional
      STORAGE_BUCKET: default
      STORAGE_ACCESS_KEY: minioadmin
      STORAGE_SECRET_KEY: minioadmin
      STORAGE_USE_SSL: false
      STORAGE_SKIP_BUCKET_CHECK: false

      # -- Crowdin (Optional) --
      # CROWDIN_PROJECT_ID:
      # CROWDIN_PERSONAL_TOKEN:

      # -- Email (Optional) --
      # DISABLE_SIGNUPS: false
      # DISABLE_EMAIL_AUTH: false

      # -- GitHub (Optional) --
      # GITHUB_CLIENT_ID: github_client_id
      # GITHUB_CLIENT_SECRET: github_client_secret
      # GITHUB_CALLBACK_URL: http://localhost:3000/api/auth/github/callback

      # -- Google (Optional) --
      # GOOGLE_CLIENT_ID: google_client_id
      # GOOGLE_CLIENT_SECRET: google_client_secret
      # GOOGLE_CALLBACK_URL: http://localhost:3000/api/auth/google/callback

volumes:
  minio_data:
  postgres_data:

There aren't any errors shown in the respective container logs, but I can't reach any of the services. Both http://<portainer-ip>:3002 and http://<portainer-ip>:3003 just give me ERR_CONNECTION_REFUSED in my browser.

I would be absolutely thrilled if somebody could help me out.

Thanks! 😊

@bootnihil
Copy link

There seem to be several issues with the ports.

  1. In the minio container, change server /data --address :"3003"server /data
  2. Under # -- Environment Variables --, change PORT: 3002PORT: 3000
  3. Under # -- URLs --, change 127.0.0.1 to your actual local IP, e.g., 192.168.0.111
  4. Under # -- Printer (Chrome) --, change ws://chrome:3002ws://chrome:3000
  5. Under # -- Storage (Minio) --, change STORAGE_PORT: 3003 to STORAGE_PORT: 9000

The UI should be then accessible at http://<your_local_IP>:3002

@coreytbacon
Copy link

coreytbacon commented Aug 17, 2024

3000 and 8000/8080 ports are industry standards for frontend and backend for use in development/local environment's. In fact they are the defaults for nextjs - the framework this project is built on.

If you decide to self host this with other self-hosted applications, in a non-isolated environment/network, then you should have the knowledge - or at least the commonsense, to google "how to change port in docker compose file" - before blaming the project.

If you are looking to run multiple application's on the same device/network, then I would suggest setting up a reverse proxy, and potentially a DNS resolver for your local/private IPs to resolve to actual hostnames - dnsmasq is a good example.

For an automated example of a reverse proxy you can combine with dnsmasq to centrally manage your network is https://github.com/nginx-proxy/nginx-proxy
It uses dockergen to automate network configuration for you based on your containers env vars.

@OddSquirrel
Copy link
Author

There seem to be several issues with the ports.

  1. In the minio container, change server /data --address :"3003"server /data
  2. Under # -- Environment Variables --, change PORT: 3002PORT: 3000
  3. Under # -- URLs --, change 127.0.0.1 to your actual local IP, e.g., 192.168.0.111
  4. Under # -- Printer (Chrome) --, change ws://chrome:3002ws://chrome:3000
  5. Under # -- Storage (Minio) --, change STORAGE_PORT: 3003 to STORAGE_PORT: 9000

The UI should be then accessible at http://<your_local_IP>:3002

Thank you very much for your help, these settings made it work inside my network. 👍

I'm still having trouble with my profile picture and PDF appearance / export, access to those is denied for some reason. But it seems like I'm not the only person with those issues.

3000 and 8000/8080 ports are industry standards for frontend and backend for use in development/local environment's. In fact they are the defaults for nextjs - the framework this project is built on.

If you decide to self host this with other self-hosted applications, in a non-isolated environment/network, then you should have the knowledge - or at least the commonsense, to google "how to change port in docker compose file" - before blaming the project.

If you are looking to run multiple application's on the same device/network, then I would suggest setting up a reverse proxy, and potentially a DNS resolver for your local/private IPs to resolve to actual hostnames - dnsmasq is a good example.

For an automated example of a reverse proxy you can combine with dnsmasq to centrally manage your network is https://github.com/nginx-proxy/nginx-proxy It uses dockergen to automate network configuration for you based on your containers env vars.

Too bad you never read my post. I never doubted well-known industry standards that I've been successfully using myself for years. Especially 9000 is a standard for Portainer, which makes it somewhat of a head scratcher to use that in a setup that will be used with Portainer by a large group of potential users.

Going by the currently 17 proxy hosts on my NGINX Proxy Manager instance, I seem to be able to use common sense and Google just fine when information is actually available.

@theschles
Copy link
Contributor

Hi @OddSquirrel ,

I just posted a PR to hopefully make it easier to start things up once the config files are set up.

You have more experience with Docker than me; any suggestions for improvements would be greatly appreciated!

@hummigbird1
Copy link

hummigbird1 commented Aug 26, 2024

Hi everyone,

I have stumbled across this post on the search for answers for the problems I am having to make this self-hosted run myself.
I have spent the better part of the day to try to make a better docker compose file but there are still things that behave weird.

After all, there is currently a open bug in regards to showing profile pictures: #1077 and more severely #1664

However I will post my incomplete works here for posterity and that someone else might build upon it.

version: "3.8"

# In this Docker Compose example, it assumes that you maintain a reverse proxy externally (or chose not to).
# The only two exposed ports here are from minio (:9000) and the app itself (:3000).
# If these ports are changed, ensure that the env vars passed to the app are also changed accordingly.

services:
  # Database (Postgres)
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes:
      - postgres_data:/var/lib/postgresql/data
    #ports:
      #- ${DB_PORT:-5432}:5432
    environment:
      POSTGRES_DB: ${DB_NAME:-postgres}
      POSTGRES_USER: ${DB_USER:-postgres}
      POSTGRES_PASSWORD: ${DB_PWD:-postgres}
    env_file:
      - .env
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-postgres}"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Storage (for image uploads)
  minio:
    image: minio/minio
    restart: unless-stopped
    command: server --address ":${MINIO_PORT:-9000}" --console-address ":${MINIO_CONSOLE_PORT:-9001}" /data
    ports:
      - "${MINIO_PORT:-9000}:9000"
      - "${MINIO_CONSOLE_PORT:-9001}:9001"
    volumes:
      - minio_data:/data
    environment:
      MINIO_ROOT_USER: ${MINIO_ROOTUSER:-minioadmin}
      MINIO_ROOT_PASSWORD: ${MINIO_ROOTPWD:-minioadmin}
    env_file:
      - .env

  # Chrome Browser (for printing and previews)
  chrome:
    image: ghcr.io/browserless/chromium:latest
    restart: unless-stopped
    #ports:
     # - ${CHROME_PORT:-3000}:3000
    environment:
      TIMEOUT: 10000
      CONCURRENT: 10
      TOKEN: ${CHROME_TOKEN:-chrome_token}
      EXIT_ON_HEALTH_FAILURE: true
      PRE_REQUEST_HEALTH_CHECK: true
    env_file:
      - .env

  app:
    image: amruthpillai/reactive-resume:latest
    restart: unless-stopped
    ports:
      - "${APP_PORT:-3000}:3000"
    depends_on:
      - postgres
      - minio
      - chrome
    environment:
      # -- Environment Variables --
      PORT: 3000
      NODE_ENV: production

      # -- URLs --
      PUBLIC_URL: http://${HOST_URL:-localhost}:${APP_PORT:-3000}
      STORAGE_URL: http://${HOST_URL:-localhost}:${MINIO_PORT:-9000}/default

      # -- Printer (Chrome) --
      CHROME_TOKEN: ${CHROME_TOKEN:-chrome_token}
      CHROME_URL: ws://chrome:3000

      # -- Database (Postgres) --
      DATABASE_URL: postgresql://${DB_USER:-postgres}:${DB_PWD:-postgres}@postgres:5432/${DB_NAME:-postgres}

      # -- Auth --
      ACCESS_TOKEN_SECRET: ${APP_ACCESSTOKENSECRET:-access_token_secret}
      REFRESH_TOKEN_SECRET: ${APP_REFRESHTOKENSECRET:-refresh_token_secret}

      # -- Emails --
      MAIL_FROM: ${APP_MAILFROM:-noreply@localhost}
      # SMTP_URL: smtp://user:pass@smtp:587 # Optional

      # -- Storage (Minio) --
      STORAGE_ENDPOINT: minio
      STORAGE_PORT: ${MINIO_PORT:-9000}
      STORAGE_REGION: eu-west-1 # Optional
      STORAGE_BUCKET: default
      STORAGE_ACCESS_KEY: ${MINIO_ROOTPWD:-minioadmin}
      STORAGE_SECRET_KEY: ${MINIO_ROOTPWD:-minioadmin}
      STORAGE_USE_SSL: false
      STORAGE_SKIP_BUCKET_CHECK: false

      # -- Crowdin (Optional) --
      # CROWDIN_PROJECT_ID:
      # CROWDIN_PERSONAL_TOKEN:

      # -- Email (Optional) --
      # DISABLE_SIGNUPS: false
      # DISABLE_EMAIL_AUTH: false

      # -- GitHub (Optional) --
      # GITHUB_CLIENT_ID: github_client_id
      # GITHUB_CLIENT_SECRET: github_client_secret
      # GITHUB_CALLBACK_URL: http://localhost:3000/api/auth/github/callback

      # -- Google (Optional) --
      # GOOGLE_CLIENT_ID: google_client_id
      # GOOGLE_CLIENT_SECRET: google_client_secret
      # GOOGLE_CALLBACK_URL: http://localhost:3000/api/auth/google/callback
    env_file:
      - .env

volumes:
  minio_data:
  postgres_data:

The .env file would then have entries like the following example:

DB_PWD=duYhpJhFzXYj7Hrx8uNwbwRUce7CQakq2B4Gx5GQqsfCJT
MINIO_ROOTPWD=yHMt5iryzFGu2woTDzS3MyWQJh6kirWQwekUbZPXq4mgYz
MINIO_PORT=9500
MINIO_CONSOLE_PORT=9501
APP_PORT=3002
CHROME_TOKEN=yLTMPchBNRYmewCZu4N5dyoJFrufDzWa3a2hvGu3a4Zdz6
APP_ACCESSTOKENSECRET=m2RGsC3yTpUT6h3NceDCpP9UWnmUpAzSVnhQKwCvobfktg
APP_REFRESHTOKENSECRET=SKbpdo9DnkL5FcwNUpwZUSWifobJakVZYZCPj89QuWQ5tF
HOST_URL=192.168.0.81

So in general the values seem to take effect, however some things are not working.
e.g.

  • when setting the MinIO password, the application seems to no longer be able to access the MinIO instance. (Some error in the logs about invalid credentials when creating the bucket)
  • Also when changing the MinIO Port, I seem to no longer be able to access the MinIO instance although according to the logs it seems to run fine.

For example with Port 9500:
image

I am not sure what is happening there or how to debug that.

So for now I am giving up on self-hosting this promising reactive resume and hope that maybe soon someone will fix those shortcomings I mentioned here.

Feel free to point out any error I may have made in my attempt for a better docker compose file (since I am no expert on the matter but a mere beginner)

PS: There seem to be more secrets used in MinIO that are not explicittly specified in the docker compose. I am not sure if they are needed, but in general I would really prefer if any secret could be explicittly changeable. I gave up though before I got to them ;)

@shriharip
Copy link

The very third statement says You can self-host the application in less than 30 seconds and we still have these things to consider. @AmruthPillai , such a nice project, could you just add few tips and things in the docs about self hosting.

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

6 participants