You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi All,
I created a standalone angular project based on the official tutorial. Then i made a research how can i add docker support to the project via nx plugin and i found this tool.
I followed the documentation. The 'init' command generated the .Dockerfile as expected, however it was incorrect.
All Dockerfile__template__ files has hardcoded as output folder 'dist/apps/...'. Since my project is SA setup i didn't have 'apps' subfolder in dist, only 'dist/my-projectname'.
When i removed the non existing subfolder from path everything worked fine.
Suggested fix
After i checked the generator code, i came up with the following ideas to fix the issue.
Fix A
Instead of hardcoding the outputPath in template files it could be read from project config, just as the projectName variable.
'target->build->options->outputPath'
Then here use COPY <%= projectOutputPath %>/package*.json ./
instead of COPY dist/apps/<%= projectName %>/package*.json ./
Fix B
Extend generator with an additional option, whether the project runs in mono repo or sa setup. Then use this info to populate 'apps' subfolder in the template files accordingly.
Affected files
All docker templates (under this folder) except empty template.
Please share you opinion on the issue. Thx.
The text was updated successfully, but these errors were encountered:
Hi All,
I created a standalone angular project based on the official tutorial. Then i made a research how can i add docker support to the project via nx plugin and i found this tool.
I followed the documentation. The 'init' command generated the .Dockerfile as expected, however it was incorrect.
All Dockerfile__template__ files has hardcoded as output folder 'dist/apps/...'. Since my project is SA setup i didn't have 'apps' subfolder in dist, only 'dist/my-projectname'.
When i removed the non existing subfolder from path everything worked fine.
Suggested fix
After i checked the generator code, i came up with the following ideas to fix the issue.
Fix A
Instead of hardcoding the outputPath in template files it could be read from project config, just as the projectName variable.
'target->build->options->outputPath'
Then here use
COPY <%= projectOutputPath %>/package*.json ./
instead of
COPY dist/apps/<%= projectName %>/package*.json ./
Fix B
Extend generator with an additional option, whether the project runs in mono repo or sa setup. Then use this info to populate 'apps' subfolder in the template files accordingly.
Affected files
All docker templates (under this folder) except empty template.
Please share you opinion on the issue. Thx.
The text was updated successfully, but these errors were encountered: