bracket icon indicating copy to clipboard operation
bracket copied to clipboard

Looks like prod.env is not read

Open SharkMachine opened this issue 4 months ago • 1 comments

I followed your guide at https://docs.bracketapp.nl/docs/running-bracket/configuration/ but it seems it isn't reading prod.env at all.

When I try to login, it gives me internal server error and I can see the following error in Firefox

Image

The logs tell me the folowing

bracket-backend   | pydantic_core._pydantic_core.ValidationError: 1 validation error for ProductionConfig
bracket-backend   | jwt_secret
bracket-backend   |   Field required [type=missing, input_value={'cors_origins': 'http://...tgres:5432/bracket_dev'}, input_type=dict]
bracket-backend   |     For further information visit https://errors.pydantic.dev/2.11/v/missing

Could I get some help with this? CORS_ORIGINS is set in prod.env.

SharkMachine avatar Aug 28 '25 18:08 SharkMachine

This version fixes two workarounds:

  1. It uses the latest version of PostgreSQL (18).
  2. There is a bug in production that, when creating an empty database, generates the error: sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) index "ix_users_email" does not exist. To fix this, you only need to change the environment setting in your docker-compose.yml file: ENVIRONMENT: "DEVELOPMENT". Restart Docker and then change the environment setting to production. It should then start normally.

services:
    bracket-frontend:
        image: ghcr.io/evroon/bracket-frontend
        container_name: bracket-frontend
        ports:
            - "3000:3000"
        environment:
            NODE_ENV: "production"
            NEXT_PUBLIC_API_BASE_URL: "https://yoursite.com:8400"
            NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "10000000-ffff-ffff-ffff-000000000001"
        restart: unless-stopped
 
    bracket-backend:
        image: ghcr.io/evroon/bracket-backend
        container_name: bracket-backend
        ports:
            - "8400:8400"
        environment:
            ENVIRONMENT: "PRODUCTION"
            PG_DSN: "postgresql://bracket_prod:bracket_prod@postgres:5432/bracket_prod"
            CORS_ORIGINS: https://yoursite.com
            JWT_SECRET: "-write here---openssl rand -hex 32--------"
			ADMIN_EMAIL: "[email protected]"
			ADMIN_PASSWORD: "youpasswordadmin" 
        volumes:
            - ./backend/static:/app/static
        restart: unless-stopped
        depends_on:
          - postgres
 
    postgres:
        image: postgres
        restart: always
        environment:
          POSTGRES_DB: bracket_prod
          POSTGRES_USER: bracket_prod
          POSTGRES_PASSWORD: bracket_prod
        volumes:
          - ./postgres:/var/lib/postgresql
   

oscartobar avatar Oct 31 '25 01:10 oscartobar