The docker file is set to build the project in this directory. The name of the project is set in the env in the DOcker file. See the first example here. To change it, modify the command in the Docker file, but you gave to adapt the docker-compose file:
docker build -t angular-init-project-temp -f init.dockerfile .
flag -e will set the name of project
docker run --rm -e "PROJECT_NAME=angular-baby" -v "<absolute path to project>:/frontend" -it angular-init-project-temp
- First, copy or move the dockercompose.yaml and Dockerfile to the project directory.
- In terminal, go to project path.
- Use the docker-compose file to run the project:
docker-compose up
- Next, mount the container, access the http://localhost:4220
- Now, you can delete the project Docker_Angular_Init_Project
if you you'd like to not get the node_modules set this:
SKIP_INSTALL
value to true. Remember that you need to node modules to auto complete VScode (text editorcd ..).
To use the ng command, use the Dockerfile or change/comment the entrypoint from docker-compose and use the command through the docker-compose (example) comment the ENTRYPOINT in the docker-compose and use the command
docker-compose run ng generate <compont name>
Or use the Dockerfile but you have to use the -v tag to mapping the container with you local machine
docker run --rm -v "<absolute path project>:/frontend" <container name>
docker-compose up --build