drogon/docker/alpine
everzone 0818384172
Add Alpine Dockerfile (#1048)
2021-10-04 23:26:09 +08:00
..
Dockerfile Add Alpine Dockerfile (#1048) 2021-10-04 23:26:09 +08:00
README.md Add Alpine Dockerfile (#1048) 2021-10-04 23:26:09 +08:00

README.md

Build Docker Image

$ cd drogon/docker/alpine # from this repository
$ docker build --no-cache --build-arg UID=`id -u` --build-arg GID=`id -g` -t drogon-alpine . # include last dot(.)

Create a Drogon Project

$ cd ~/drogon_app # example
$ docker run --rm -v="$PWD:/drogon/app" -w="/drogon/app" drogon-alpine drogon_ctl create project hello_world

Build the Project

$ cd hello_world
$ docker run --rm --volume="$PWD:/drogon/app" -w="/drogon/app/build" drogon-alpine sh -c "cmake .. && make"

Start Server

$ docker run --name drogon_test --rm -u 0 -v="$PWD/build:/drogon/app" -w="/drogon/app" -p 8080:80 -d drogon-alpine ./hello_world # expose port 80 to 8080

Stop Server

$ docker kill drogon_test