split-pro icon indicating copy to clipboard operation
split-pro copied to clipboard

Can't access the web interface on docker installation

Open josefhelie opened this issue 10 months ago • 6 comments

Hello,

Here is Josef, I wrote you yesterday on reddit to tell you I wad trying to import data from Tricount, export done and I want to try out my conversion tool. I'm now at the stage I need to install your app, but without any success. I can't access the web interface. Can you help me? I tried everything I had in mind.

My docker compose:

services:
  postgres:
    image: postgres:16
    container_name: splitpro-db-prod
    restart: always
    environment:
      - POSTGRES_USER=${POSTGRES_USER:?err}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}
      - POSTGRES_DB=${POSTGRES_DB:?err}
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER}']
      interval: 10s
      timeout: 5s
      retries: 5
#   ports:
#     - 5432:5432
    volumes:
      - /volume2/docker/splitpro/db:/var/lib/postgresql/data

  splitpro:
    image: ossapps/splitpro:latest
    container_name: splitpro
    restart: always
    ports:
      - ${PORT:-3025}:${PORT:-3000}
    environment:
#      - HOSTNAME=0.0.0.0
      - PORT=${PORT:-3025}
      - DATABASE_URL=${DATABASE_URL:?err}
      - NEXTAUTH_URL=${NEXTAUTH_URL:?err}
      - NEXTAUTH_SECRET=${NEXTAUTH_SECRET:?err}
      - ENABLE_SENDING_INVITES=${ENABLE_SENDING_INVITES:?err}
      - FROM_EMAIL=${FROM_EMAIL}
      - EMAIL_SERVER_HOST=${EMAIL_SERVER_HOST}
      - EMAIL_SERVER_PORT=${EMAIL_SERVER_PORT}
      - EMAIL_SERVER_USER=${EMAIL_SERVER_USER}
      - EMAIL_SERVER_PASSWORD=${EMAIL_SERVER_PASSWORD}
      - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
      - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
      - AUTHENTIK_ID=${AUTHENTIK_ID}
      - AUTHENTIK_SECRET=${AUTHENTIK_SECRET}
      - AUTHENTIK_ISSUER=${AUTHENTIK_ISSUER}
      - R2_ACCESS_KEY=${R2_ACCESS_KEY}
      - R2_SECRET_KEY=${R2_SECRET_KEY}
      - R2_BUCKET=${R2_BUCKET}
      - R2_URL=${R2_URL}
      - R2_PUBLIC_URL=${R2_PUBLIC_URL}
      - WEB_PUSH_PRIVATE_KEY=${WEB_PUSH_PRIVATE_KEY}
      - WEB_PUSH_PUBLIC_KEY=${WEB_PUSH_PUBLIC_KEY}
      - WEB_PUSH_EMAIL=${WEB_PUSH_EMAIL}
      - FEEDBACK_EMAIL=${FEEDBACK_EMAIL}
      - DISCORD_WEBHOOK_URL=${DISCORD_WEBHOOK_URL}
    depends_on:
      postgres:
        condition: service_healthy

My env file:

#********* REQUIRED ENV VARS *********

# Prisma
# DataBase ENV VARS
# You could give a DB URL or give the username, password, host, port individually
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DATABASE_URL=""postgresql://splitpro:edited@splitpro-db-prod:5432/splitpro""

# These variables are also used by docker compose in compose.yml to name the container
# and initialise postgres with default username, password
POSTGRES_USER="splitpro"
POSTGRES_PASSWORD="edited"
POSTGRES_DB="splitpro"
# DATABASE_URL=""postgresql://splitpro:edited@splitpro-db-prod:5432/splitpro""

# Next Auth
# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
 NEXTAUTH_SECRET="l80ruVPvEcM9YjhbWuNoVHDwK52WgfEY2EGz5L8Fjc8="
 NEXTAUTH_URL="http://localhost:3025"

# If provided, server-side calls will use this instead of NEXTAUTH_URL. Useful in environments when the server doesn't have access to the canonical URL of your site.
# NEXTAUTH_URL_INTERNAL="http://localhost:3000"


# Enable sending invites
ENABLE_SENDING_INVITES=false
#********* END OF REQUIRED ENV VARS *********

Container logs:

Deploying prisma migrations

+ echo 'Deploying prisma migrations'

+ pnpx prisma migrate deploy --schema ./prisma/schema.prisma

Progress: resolved 1, reused 0, downloaded 0, added 0

Progress: resolved 7, reused 6, downloaded 0, added 0

������
Packages: +6

++++++

Progress: resolved 7, reused 6, downloaded 0, added 6, done

.../[email protected]/node_modules/prisma preinstall$ node scripts/preinstall-entry.js

.../[email protected]/node_modules/prisma preinstall: Done

Prisma schema loaded from prisma/schema.prisma

Datasource "db": PostgreSQL database "splitpro", schema "public" at "splitpro-db-prod:5432"

7 migrations found in prisma/migrations

No pending migrations to apply.

+ echo 'Starting web server'

+ node server.js

Starting web server

   ▲ Next.js 14.1.0

   - Local:        http://localhost:3025

   - Network:      http://0.0.0.0:3025

 ✓ Ready in 557ms

josefhelie avatar Feb 16 '25 00:02 josefhelie

I tried creating a dedicated network, same same... I hope someone will be able to help me :)

josefhelie avatar Feb 18 '25 18:02 josefhelie

Try to set NEXTAUTH_URL="http://localhost:3025" to the real URL, if you use a proxy this could be "https://splitpro.example.com".

And allow ENABLE_SENDING_INVITES=true.

Targunitoth avatar Mar 04 '25 10:03 Targunitoth

Same same... I use a reverse proxy, running several docker apps without any problem. My only issue is with splitpro...

Deploying prisma migrations

+ echo 'Deploying prisma migrations'

+ pnpx prisma migrate deploy --schema ./prisma/schema.prisma

Progress: resolved 1, reused 0, downloaded 0, added 0

Progress: resolved 5, reused 0, downloaded 3, added 0

Progress: resolved 33, reused 0, downloaded 8, added 0

Progress: resolved 36, reused 0, downloaded 10, added 0

Packages: +11

+++++++++++

Progress: resolved 36, reused 0, downloaded 11, added 11, done

.../node_modules/@prisma/engines postinstall$ node scripts/postinstall.js

.../node_modules/@prisma/engines postinstall: Done

.../[email protected]/node_modules/esbuild postinstall$ node install.js

.../[email protected]/node_modules/esbuild postinstall: Done

.../[email protected]/node_modules/prisma preinstall$ node scripts/preinstall-entry.js

.../[email protected]/node_modules/prisma preinstall: Done

Prisma schema loaded from prisma/schema.prisma

Datasource "db": PostgreSQL database "splitpro", schema "public" at "splitpro-db-prod:5432"

7 migrations found in prisma/migrations

No pending migrations to apply.

Starting web server

+ echo 'Starting web server'

+ node server.js

   ▲ Next.js 14.1.0

   - Local:        http://localhost:3025

   - Network:      http://0.0.0.0:3025

 ✓ Ready in 975ms

josefhelie avatar Mar 07 '25 17:03 josefhelie

@KMKoushik can you help me with that please? I really want to use your app!

josefhelie avatar Mar 11 '25 16:03 josefhelie

You do not expose the port if i read your configuration correct: ports: - 3007:${PORT:-3000}

Soulplayer avatar Mar 11 '25 16:03 Soulplayer

Well actually I probably messed up something with the ports yes... It works now. Thanks for your help!

josefhelie avatar Mar 11 '25 22:03 josefhelie