question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where and how to use config file?

See original GitHub issue

I’ve added the config file to the route direct where the docker-compose files are - image

I’ve added oidc-server-mock as a service in the docker-compose file -

version: '3.4'
volumes:
  db-data:
  
services:
  sql-server-db:
    container_name: sql-server-db
    image: mcr.microsoft.com/mssql/server:2017-latest
    volumes:
      - db-data:/var/opt/mssql/data
    environment:
        ACCEPT_EULA: "Y"
        SA_PASSWORD: "Pa55w0rd2019"
        MSSQL_PID: Express
    ports:
        - "1433:1433"
  smtp-server:
    container_name: smtp-server
    image: mailhog/mailhog:latest
    restart: always
    logging:
     driver: 'none'  # disable saving logs
    ports:
      - "1025:1025" # SMTP
      - "8025:8025" # Web UI

  azurite:
    container_name: azurite
    image: mcr.microsoft.com/azure-storage/azurite
    hostname: azurite
    command: "azurite-blob --loose --blobHost 0.0.0.0"
    ports:
      - "10000:10000"
    volumes:
      - ./test/azurite:/data

  oidc-server-mock:
    container_name: oidc-server-mock
    image: ghcr.io/soluto/oidc-server-mock:latest
    ports:
      - '4011:80'
    environment:
      ASPNETCORE_ENVIRONMENT: Development
      SERVER_OPTIONS_INLINE: |
        {
          "AccessTokenJwtType": "JWT",
          "Discovery": {
            "ShowKeySet": true
          },
          "Authentication": {
            "CookieSameSiteMode": "Lax",
            "CheckSessionCookieSameSiteMode": "Lax"
          }
        }
      LOGIN_OPTIONS_INLINE: |
        {
          "AllowRememberLogin": false
        }
      LOGOUT_OPTIONS_INLINE: |
        {
          "AutomaticRedirectAfterSignOut": true
        }
      API_SCOPES_INLINE: |
        - Name: some-app-scope-1
        - Name: some-app-scope-2
      API_RESOURCES_INLINE: |
        - Name: some-app
          Scopes:
            - some-app-scope-1
            - some-app-scope-2
      USERS_CONFIGURATION_INLINE: |
        [
          {
            "SubjectId":"1",
            "Username":"User1",
            "Password":"pwd",
            "Claims": [
              {
                "Type": "name",
                "Value": "Sam Tailor",
                "ValueType": "string"
              },
              {
                "Type": "email",
                "Value": "sam.tailor@gmail.com",
                "ValueType": "string"
              },
              {
                "Type": "some-api-resource-claim",
                "Value": "Sam's Api Resource Custom Claim",
                "ValueType": "string"
              },
              {
                "Type": "some-api-scope-claim",
                "Value": "Sam's Api Scope Custom Claim",
                "ValueType": "string"
              },
              {
                "Type": "some-identity-resource-claim",
                "Value": "Sam's Identity Resource Custom Claim",
                "ValueType": "string"
              }
            ]
          }
        ]
      CLIENTS_CONFIGURATION_PATH: /oidc-client-config.json
      ASPNET_SERVICES_OPTIONS_INLINE: |
        { 
          "ForwardedHeadersOptions": { 
            "ForwardedHeaders" : "All"
          }
        }
    volumes:
      - .:/tmp/config:ro

  admin:
    container_name: admin
    depends_on:
        - sql-server-db
        - smtp-server
        - azurite
    build:
      context: .
      dockerfile: Scr/Admin/Dockerfile
    ports:
        - "8080:80"
    environment:
        - ASPNETCORE_ENVIRONMENT=Developement
        - MailHostUrl=smtp-server
        - MailPort=1025
        - DatabaseConnections__EmailDb=Server=sql-server-db,1433;Initial Catalog=EmailTestData;User ID =SA;Password=Pa55w0rd2019;TrustServerCertificate=true;

  api:
    container_name: api
    depends_on:
        - sql-server-db
        - smtp-server
        - azurite
    build:
      context: .
      dockerfile: Scr/Api/Dockerfile
    ports:
        - "8010:80"
    environment:
        - ASPNETCORE_ENVIRONMENT=Developement
        - MailHostUrl=smtp-server
        - MailPort=1025
        - DatabaseConnections__EmailDb=Server=sql-server-db,1433;Initial Catalog=EmailTestData;User ID =SA;Password=Pa55w0rd2019;TrustServerCertificate=true;

But the oidc-server-mock container fails to start -

2023-06-27 13:25:42 File name: '/oidc-client-config.json'
2023-06-27 13:25:42    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
2023-06-27 13:25:42    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
2023-06-27 13:25:42    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
2023-06-27 13:25:42    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
2023-06-27 13:25:42    at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
2023-06-27 13:25:42    at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
2023-06-27 13:25:42    at System.IO.File.InternalReadAllText(String path, Encoding encoding)
2023-06-27 13:25:42    at System.IO.File.ReadAllText(String path)
2023-06-27 13:25:42    at OpenIdConnectServer.Config.GetClients() in /src/Config.cs:line 117
2023-06-27 13:25:42    at Program.<Main>$(String[] args) in /src/Program.cs:line 38

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
IeuanWalkercommented, Jul 3, 2023

thanks, sorry this is the first project i’ve ever used docker for, so my knowledge is pretty low around docker

0reactions
agutierrezgitcommented, Aug 15, 2023

Try updating the volumes path. Check the example in E2E test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a config file?
Configuration formats help developers store the data their applications need and help users store preferences for how they want applications to ...
Read more >
What is a configuration file?
Overview. A configuration file (config file) is code on your computer that allows the selection of various features and settings.
Read more >
What Config Files Are & How They Work
Like you can probably guess, config is short for configuration. These files hold any initial settings or parameters that your project is going ......
Read more >
What Are CFG and CONFIG Files, and How Do You Open ...
CONFIG file extension is a configuration file used by various programs to store settings that are specific to their respective software. Some configuration...
Read more >
Configuration File? Files?
If you have a config file you want to use to replace the current config on a router, the recommended approach would be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found