Structure of Angular / NodeJS repository which will run in docker

We have repository with an application written in Angular.
It needs a docker container with nginx to be hosted.
The nodejs needs a docker container of nodejs so our app will be split up in 2 containers which will be linked.

So to write 2 dockerfiles (one for each image) we have to split up our folders in our repo like:

  • How to get hostPort mapped inside Docker Container in AWS ECS
  • How to allow my host IP address in the PostgreSQL pg_hba.conf file
  • docker compose file not working: replicas Additional property replicas is not allowed
  • Docker Nginx with Angular JS - Load Static CSS, Images, JS with dynamic url
  • Docker Error response from daemon: service endpoint with name.
  • Can I use privileged Docker container to spawn other containers on host?
    • root

      • Angular : contains dockerfile for nginx

      • NodeJS : contains dockerfile for nodejs

    But the problem is they both need the package.json. (Angular for devdependencies and NodeJS for the dependencies).

    Which is the best structure in the repo for your application?

  • CMD dockerfile is not executed
  • Pulling docker image python:2.7-onbuild taking a long time
  • How to run and install Protractor E2E tests in Docker container for Laravel?
  • How do I run 2 environments of SkyDns/Skydock simultaneously?
  • Where i can find windows 64 bit box for vagrant
  • Rebuild Docker container on file changes
  • One Solution collect form web for “Structure of Angular / NodeJS repository which will run in docker”

    The Nginx and Nodejs containers can share a volume in Docker Compose if you like. You can use the volumes_from parameter. It will mount all of the volumes from another service or container, optionally specifying read-only access(ro) or read-write(rw). https://docs.docker.com/compose/compose-file/

        volumes_from:
          - service_name
          - container_name
          - service_name:rw
    

    In your case, package.json can be in your Nodejs container but it can also be accessible by the Nginx container using this parameter.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.