Docker templates for different programming languages

@Curtis Lewis Curtis Lewis authored on 2 Jul
angular initial commit angular instructions 11 months ago
python Added docker template files for python project 10 months ago
.gitignore Added docker template files for python project 10 months ago
README.md Added docker template files for python project 10 months ago
README.md

docker_templates

Docker templates for different programming languages

Angular

Move Dockerfile, docker-compose.yml and .dockerignore into top level Angular app directory (my_angular_app/ and not my_angular_app/src)

Make the following changes in package.json

"scripts": {
   ...
   "start": "ng serve --host 0.0.0.0",
   ...
 }

Ref answer by Hans Kilian on S.O.: https://stackoverflow.com/questions/74467776/problem-connecting-to-angular-app-in-docker

Ref Docker / Angular live-reload ... https://www.freecodecamp.org/news/how-to-enable-live-reload-on-docker-based-applications/

docker volume create nodemodules
docker build -t MY_IMAGE_NAME
docker run --name app -p 4200:4200 -v nodemodules:/src/node_modules  -v .:/src  MY_IMAGE_NAME

Python

For the local version of docker compose, the environment variables shown are required if the app needs to use GCP client libraries.

For production, there may be additional permissions that are required to run the application on GCP.

Docker / Docker Compose Notes

Start via Docker compose

docker compose up

and to shut down

docker compose down

Build

docker build -t <TAG_NAME> -f <DOCKERFILE_NAME> .
docker compose -f <DOCKER_COMPOSE_FILENAME> {up | down}