Skip to content

Instantly share code, notes, and snippets.

@risha700
Last active March 19, 2025 09:13
Show Gist options
  • Save risha700/25e97b1bf1990d65ba9be8eceba3a9ff to your computer and use it in GitHub Desktop.
Save risha700/25e97b1bf1990d65ba9be8eceba3a9ff to your computer and use it in GitHub Desktop.
cortezaproject docker compose
  • create docker-compose.yml
services:
  db:
    # PostgreSQL Database
    # See https://hub.docker.com/_/postgres for details
    # Support for postgres 13, 14 and 15 is available in the latest version of Corteza
    image: postgres:15 # current 17.x :(
    # networks: [ internal ]
    restart: always
    healthcheck: { test: ["CMD-SHELL", "pg_isready -U corteza"], interval: 10s, timeout: 5s, retries: 5 }
    volumes:
      - "dbdata:/var/lib/postgresql/data"
    environment:
      # Warning: these are values that are only used on 1st start
      #          if you want to change it later, you need to do that
      #          manually inside db container
      POSTGRES_USER:     corteza
      POSTGRES_PASSWORD: corteza


  server:
    # image: cortezaproject/corteza-server-monolith:${VERSION}
    image: cortezaproject/corteza:${VERSION}
    restart: on-failure
    env_file: [ .env ]
    volumes: [ "./data/server:/data" ]
    environment:
      VIRTUAL_HOST: ${DOMAIN}
      # Informing Corredor where it he contact us
      # CORREDOR_API_BASE_URL_SYSTEM:    "http://server:80/system"
      # CORREDOR_API_BASE_URL_MESSAGING: "http://server:80/messaging"
      # CORREDOR_API_BASE_URL_COMPOSE:   "http://server:80/compose"
      # CORREDOR_ADDR:                   "corredor:${LOCAL_DEMO_CRD_PORT}"
    depends_on: [ db ]
    # Binds internal port 80 to port LOCAL_DEMO_API_PORT on localhost
    # ports: [ "127.0.0.1:${LOCAL_DEMO_API_PORT}:80" ]
    ports: [ "127.0.0.1:18084:80" ]


volumes:
  dbdata:

networks:
  internal: {}
  proxy: { external: true }  
  • create .env file
# Version of Corteza Docker images
VERSION=2023.3



# Secret to use for JWT token
# Make sure you change it (>30 random characters) if
# you expose your deployment to outside traffic
AUTH_JWT_SECRET=569e83bffab354f4df17c982e15c0fffee903e6b91352f7c51c2257cb245df19

########################################################################################################################
# docker-compose supports environment variable interpolation/substitution in compose configuration file
# (more info: https://docs.docker.com/compose/environment-variables)

########################################################################################################################
# General settings
DOMAIN=localhost:18084

########################################################################################################################
# Database connection
DB_DSN=postgres://corteza:corteza@db:5432/corteza?sslmode=disable

########################################################################################################################
# Server settings

# Running all-in-one and serving web applications directly from server container
HTTP_WEBAPP_ENABLED=true

# Disabled, we do not need detailed persistent logging of actions in local env
ACTIONLOG_ENABLED=false

########################################################################################################################
# SMTP (mail sending) settings

# Point this to your local or external SMTP server if you want to send emails.
# In most cases, Corteza can detect that SMTP is disabled and skips over sending emails without an error
#SMTP_HOST=smtp-server.example.tld:587
#[email protected]
#SMTP_PASS=this-is-your-smtp-password
#SMTP_FROM='"Demo" <[email protected]>'

create both files in a directory and then

docker compose up -d 

then visit

localhost:18084

create a new user and it will elevate privilige as admin if first user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment