nx-tools
nx-tools copied to clipboard
Feature Request(nx-docker): Default Docker Files
As it stands a docker file is needed for each project that a user wishes to Dockerize.
I believe that nx-docker
is in a position to provide a default Dockerfile that installs from either the root package.json
or a provided one and runs the production build commands.
Of course a custom Dockerfile should be allowed however for common applications like NestJS, Angular, Node, React, etc. it may not be necessary to require a user of this library to provide one.
Perhaps we can look at the builder for the build
command and determine what preset to use as nwrl uses different builders for each of these projects.
This feature would also make it much easier for those who use Nwrl Nx to get into dockerizing applications without any prior knowledge of Docker.
That would be really great. I'm currently struggeling to find out why docker is not able to pick up the files that I build with nx before. And example would also already be very very helpful, because although I'm used to creating Dockerfiles for me there is this blank spot in connecting nx build with docker and how putting the dist into it really should look like.
Any news on this? I have no idea how to create a Dockerfile that will be used by nx-docker.
There's is nothing special about Dockerfiles for nx-docker, it's just a normal Dockerfile.
Please check this repository https://github.com/gperdomor/nx-docker-sandbox, every app has is own Dockerfile according the type of app, also check the docker target of each app in their corresponding project.json
This is handled in init
generator of @nx-tools/nx-container
plugin...