To dockerize an Ionic Angular and Nest Monorepo(NX) application, you can follow these general steps:
Here is an overview of my NX Application folder structure
Step 1: Create a Dockerfile: Start by creating a Dockerfile at the root of your project. The Dockerfile should contain instructions for building your application within a Docker container. For example:
ARG NODE_VERSION=18.17.0
Step 2. Build the Angular and Nest applications: Write the necessary commands in the Dockerfile to build both the Angular and Nest applications. You may need to install dependencies, build the applications, and copy the necessary files into the container.
My finding was that Ionic does not run with just localhost:4200 as it would normally. I had to add HOST for my script in package.json.
Step 3. Compose Configuration: If your applications require any specific ports to be exposed, make sure to include instructions for exposing these ports in the Dockerfile as well.
Step 4. Build the Docker image: Once the Dockerfile is set up, you can build the Docker image using the docker compose build command.
Step 5. Run the Docker container: After the Docker image is built, you can run a Docker container using the docker compose up command. Make sure to map any required ports and volumes if needed.
By following these steps, you can dockerize your Ionic Angular and Nest (NX) application, allowing you to run it in a containerized environment.
Please let me know if this works for you. If you need further assistance, don't hesitate to reach out. SHALOM!