Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect outputPath in Dockerfile__template__ in case of SA project #855

Open
alexIslander opened this issue Aug 9, 2023 · 0 comments
Open

Comments

@alexIslander
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant