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:

  • Docker container keeps growing
  • How to setup gitlab container registry inside docker?
  • Generate all locales in a docker image
  • How to install latest version of make in centos6.6 docker container
  • How to handle web application static resources wich browser-cache in kubernetes?
  • Docker installation for running node and react environment
    • 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?

  • pecl install mongo command for mongo-1.5.5.tgz produce invalid tgz error
  • replicas of a service in docker swarm remain 0/1 forever
  • Issue in setting --sysctl net.core parameter with docker container
  • Running commands inside Docker Container
  • NetfilterQueue not working in a docker container
  • Run Command Inside of Docker Container Using Ansible
  • 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).

          - 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.