I'm using the JSS variant image from this repo with the docker image details below:
On startup I can see the home page just fine, however as soon as I start to try and to deploy the JSS app to Sitecore I started to get the following exception.
Exception thrown while importing JSS app
Exception: Sitecore.Exceptions.AccessDeniedException
at Sitecore.JavaScriptServices.AppServices.ImportService.ImportJob.StartImportInternal()
Import is complete.
IMPORT ERROR(S) OCCURRED!
Exception thrown while importing JSS app
Exception: Sitecore.Exceptions.AccessDeniedException
Message: AddFromTemplate - Add access required (destination: {825B30B4-B40B-422E-9920-23A1B6BDA89C}, template: {0437FEE2-44C9-46A6-ABE9-28858D9FEE8C})
Source: Sitecore.Kernel
at Sitecore.Diagnostics.Assert.HasAccess(Boolean accessAllowed, String message)
at Sitecore.Data.Managers.ItemProvider.AddFromTemplate(String itemName, ID templateId, Item destination, ID newId)
at Sitecore.Data.Managers.DefaultItemManager.AddFromTemplate(String itemName, ID templateId, Item destination, ID newItemId)
at Sitecore.Data.Managers.ItemManager.AddFromTemplate(String itemName, ID templateId, Item destination, ID newItemId)
at Sitecore.Data.Items.Item.Add(String name, TemplateID templateID, ID newItemID)
at Sitecore.JavaScriptServices.AppServices.Data.ItemPathCreator.CreateItemPath(Database db, String path, TemplateItem folderTemplate, TemplateItem itemTemplate, String idNamespace, IdManager idManager, AppConfiguration app, ID targetItemId)
at Sitecore.JavaScriptServices.AppServices.Data.ItemPathCreator.GetOrCreatePath(Database database, String path, TemplateItem folderTemplate, TemplateItem itemTemplate, String idNamespace, IdManager idManager, AppConfiguration app, Boolean& isNew)
at Sitecore.JavaScriptServices.AppServices.Data.ItemPathCreator.GetOrCreatePath(Database database, String path, TemplateItem folderTemplate, TemplateItem itemTemplate, String idNamespace, IdManager idManager, AppConfiguration app)
at Sitecore.JavaScriptServices.AppServices.Pipelines.Import.CreateTemplatesContainer.DoProcess(ImportPipelineArgs args, Database database, ItemPathCreator itemPathCreator)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.JavaScriptServices.AppServices.Pipelines.Import.ImportPipeline.Import(ImportPipelineArgs args)
at Sitecore.JavaScriptServices.AppServices.ImportService.ImportJob.StartImportInternal()
After fiddling around, I've noticed that the JSS Import user is missing and reinstalling the JSS zip package and rerunning the import seems to have to confirm the issue. This might be due to the fact that during docker build process, the JSS Import user from the package is not saved somewhere (either serialized to the file system or in a database)
I've looked at other Docker image repo from the community and it seems this repo solve the problem by approaching it differently.