Web Servers and APIs using C++ course
On folder /hello_crow/bbox docker build --rm --squash --no-cache -t bbox:latest .
docker run -v ~Location:/usr/src/cppweb -ti bbox:latest bash
Dockerfile has been updated to build by itself (Run docker image section)
Older version : cd /usr/src/cppweb/hello_crow/build cmake .. build
docker run -v ~Location:/usr/src/cppweb -p 8080:8080 -e PORT=8080 cppbox:latest /usr/src/cppweb/hello_crow/build/hello_crow
hello_crow is the app to run. Is the executable cmake built.
Run the container -> docker run -ti cppbox:latest bash Get container id -> docker ps -> copy id -> docker cp . :/usr/src/cppweb docker commit hello_crow:latest
Get image id -> docker images -> copy id docket tag /hello_crow:latest docker push /hello_crow
docker run -p 8080:8080 -e PORT=8080 /hello_crow
Don't know if launching the app is necessary. Just in case: docker run -p 8080:8080 -e PORT=8080 /hello_crow /usr/src/cppweb/hello_crow/build/hello_crow
Or even docker run -v ~Location:/usr/src/cppweb -p 8080:8080 -e PORT=8080 /hello_crow /usr/src/cppweb/hello_crow/build/hello_crow
docker build --rm --squash --no-cache -t hello_crow_v2:latest .
Railway : docker run -p 8080:8080 -e PORT=8080 -e MONGODB_URI="://:@" hello_crow:latest railwayProjectAddress is given by Railway
MongoDB Atlas : docker run -p 8080:8080 -e PORT=8080 -e MONGODB_URI="://:@" hello_crow:latest mongodbAddress is given by MongoDB