Local development - culinary-code/algemeen GitHub Wiki

Running everything locally for development purposes

About the LLM model

While you are free to use any LLM model you prefer, we have spent considerable time researching which model best fits our needs, read more about this on the Recommended LLM Model page.

Running docker

In case you want to develop new features for this application, the easiest way to get the different services running would be through Docker. We have provided a Docker compose file that does not include the backend service so you can easily run all required services at once.

Example Docker compose file without the backend image.

name: culinary-code

services:
  idp_postgres:
    image: postgres:15.4-alpine
    volumes:
      - idp_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password
    ports:
        - "5433:5432"

  idp_keycloak:
      image: steffenvochten/culinarycode_idp
      environment:
        - KEYCLOAK_ADMIN=admin
        - KEYCLOAK_ADMIN_PASSWORD=admin
        - KC_DB=postgres
        - KC_DB_URL_HOST=idp_postgres
        - KC_DB_URL_DATABASE=keycloak
        - KC_DB_USERNAME=keycloak
        - KC_DB_PASSWORD=password
      command: 
        - start-dev
      ports:
        - "8180:8080"
      depends_on:
        - idp_postgres
    
  postgres:
    image: postgres:15
    container_name: postgres-db
    environment:
      POSTGRES_USER: myuser
      POSTGRES_PASSWORD: mypassword
      POSTGRES_DB: mydatabase
    ports:
      - "5432:5432"
    volumes:
      - backend_data:/var/lib/postgresql/data

volumes:
  backend_data:
  idp_data:

If you are a frontend developer and only wish to make visual changes to the frontend, you can also include our backend image.

Example Docker compose file including the backend image, for more information about the environment variables, please visit Environment Variables

name: culinary-code

services:
  idp_postgres:
    image: postgres:15.4-alpine
    volumes:
      - idp_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password
    ports:
        - "5433:5432"

  idp_keycloak:
      image: steffenvochten/culinarycode_idp
      environment:
        - KEYCLOAK_ADMIN=admin
        - KEYCLOAK_ADMIN_PASSWORD=admin
        - KC_DB=postgres
        - KC_DB_URL_HOST=idp_postgres
        - KC_DB_URL_DATABASE=keycloak
        - KC_DB_USERNAME=keycloak
        - KC_DB_PASSWORD=password
      ports:
        - "8180:8080"
      depends_on:
        - idp_postgres
    
  postgres:
    image: postgres:15
    container_name: postgres-db
    environment:
      POSTGRES_USER: myuser
      POSTGRES_PASSWORD: mypassword
      POSTGRES_DB: mydatabase
    ports:
      - "5432:5432"
    volumes:
      - backend_data:/var/lib/postgresql/data

  backend:
    image: steffenvochten/culinarycode_backend
    container_name: backend
    environment:
        ASPNETCORE_ENVIRONMENT=Development;
        ASPNETCORE_HTTPS_PORT=443;
        ASPNETCORE_URLS=https://0.0.0.0:7098\;http://0.0.0.0:5114;
        AzureOpenAI__ApiKey={YOUR_API_KEY};
        AzureOpenAI__Endpoint={YOUR_ENDPOINT};
        AzureStorage__ConnectionString={YOUR_CONNECTION_STRING};
        AzureStorage__ContainerName={YOUR_CONTAINER_NAME};
        Database__ConnectionString={YOUR_CONNECTION_STRING};
        Keycloak__AdminPassword={YOUR_PASSWORD};
        Keycloak__AdminUsername={YOUR_USERNAME};
        Keycloak__BaseUrl=http://localhost:8180;
        Keycloak__ClientId={YOUR_CLIENT_ID};
        Keycloak__FrontendUrl=http://localhost:8180;
        Keycloak__Realm={YOUR_REALM};
        LocalLlmServer__ServerUrl=http://localhost:4891;
        RecipeJob__CronSchedule=0 0 2 * * ?;
        RecipeJob__MinAmount=5
        EmailService__SmtpClient
        EmailService__SmtpPassword
        EmailService__SmtpUserName
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - idp_keycloak
      - postgres

volumes:
  backend_data:
  idp_data: