Skip to content

docker compose installation. #3160

Open
@alessiocamillohome

Description

@alessiocamillohome

Hello everyone,
i am trying to install the fhir-api server and database using the docker-compose command and following the instructions report in the documentation (https://github.com/microsoft/fhir-server/tree/main/samples/docker):

Using docker-compose this image can be started with the following steps:
Open a terminal window.
Set the enviornment variable SAPASSWORD to what you want the SQL access password to be. Be sure to follow the [SQL server password complexity requirements](https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver15#password-complexity).
Copy & save a local version of the docker-compose file from the release directory of the fhir-server project.
Run the command:
docker-compose up -d .
After giving the container a minute to start up it should be accessable at http://localhost:8080/metadata.

Unfortunately in the Log I have the following error which I think does not start the fhir-api server correctly.

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
fhir-server-fhir-api-1  |    at System.Lazy`1.CreateValue()
fhir-server-fhir-api-1  |    at Hl7.FhirPath.FhirPathCompiler.get_DefaultSymbolTable()
fhir-server-fhir-api-1  |    at Microsoft.Health.Fhir.Api.Modules.FhirModule.Load(IServiceCollection services) in /repo/src/Microsoft.Health.Fhir.Shared.Api/Modules/FhirModule.cs:line 58
fhir-server-fhir-api-1  |    at Microsoft.Health.Extensions.DependencyInjection.ServiceCollectionExtensions.RegisterModule(IServiceCollection collection, Type moduleType, Object[] constructorParams)
fhir-server-fhir-api-1  |    at Microsoft.Health.Extensions.DependencyInjection.ServiceCollectionExtensions.RegisterAssemblyModules(IServiceCollection collection, Assembly assembly, Object[] constructorParams)
fhir-server-fhir-api-1  |    at Microsoft.Extensions.DependencyInjection.FhirServerServiceCollectionExtensions.AddFhirServer(IServiceCollection services, IConfiguration configurationRoot, Action`1 configureAction) in /repo/src/Microsoft.Health.Fhir.Shared.Api/Registration/FhirServerServiceCollectionExtensions.cs:line 88
fhir-server-fhir-api-1  |    at Microsoft.Health.Fhir.Web.Startup.ConfigureServices(IServiceCollection services) in /repo/src/Microsoft.Health.Fhir.Shared.Web/Startup.cs:line 45
fhir-server-fhir-api-1  |    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
fhir-server-fhir-api-1  |    at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
fhir-server-fhir-api-1  |    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.<ConfigureServices>g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.WebHost.EnsureApplicationServices()
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.WebHost.Initialize()
fhir-server-fhir-api-1  |    at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
fhir-server-fhir-api-1  |    at Microsoft.Health.Fhir.Web.Program.Main(String[] args) in /repo/src/Microsoft.Health.Fhir.Shared.Web/Program.cs:line 20

The full docker-compose file:

version: "3"
services:
  fhir-api:
    image: "mcr.microsoft.com/healthcareapis/r4-fhir-server"
    restart: on-failure
    environment:
      FHIRServer__Security__Enabled: "false"
      SqlServer__ConnectionString: "Server=tcp:sql,1433;Initial Catalog=FHIR;Persist Security Info=False;User ID=sa;Password=<SAPASSWORD>;MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=true;"
      SqlServer__AllowDatabaseCreation: "true"
      SqlServer__Initialize: "true"
      SqlServer__SchemaOptions__AutomaticUpdatesEnabled: "true"
      DataStore: "SqlServer"
    ports:     
      - "8080:8080"
    depends_on:
      - sql
  sql:
    image: "mcr.microsoft.com/mssql/server"
    environment:
      SA_PASSWORD: <SAPASSWORD>
      ACCEPT_EULA: "Y"
    healthcheck:
        test: ["CMD", "/opt/mssql-tools/bin/sqlcmd","-U sa -P <SAPASSWORD> -Q 'SELECT * FROM INFORMATION_SCHEMA.TABLES'"]
        interval: 10s
        timeout: 10s
        retries: 6

My working environment is a Macbook M1 Pro with macOS Ventura 13.2.1.
The version of Docker is 20.10.23 (with Use Virtualization framework and Use Rosetta for x86/amd64 emulation on Apple Silicon checked)
Is this environment supported for this version of the fhir server?

Thanks for your support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions