From 9fa0ff195fabbf48ebdd71fde505a1398ae06ea9 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Sat, 10 Apr 2021 10:32:55 +0500 Subject: [PATCH] Updated dockerfile --- Dockerfile | 16 +++++++++++----- readme.txt | 9 ++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e6da62..f365972 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ -FROM ubuntu:18.04 +FROM heroku/heroku:20-build as builder WORKDIR /app -COPY . /app +COPY . . -RUN apt update -y && apt install make clang -y +RUN make -RUN make +FROM heroku/heroku:20 -CMD ["./build/server", "$PORT"] \ No newline at end of file +WORKDIR /srv + +COPY --from=builder /app . + +RUN echo 5000 + +CMD ["./build/server", "5000"] \ No newline at end of file diff --git a/readme.txt b/readme.txt index a9c1859..87166f0 100644 --- a/readme.txt +++ b/readme.txt @@ -1 +1,8 @@ -Webserver in c. !Experimental! \ No newline at end of file +Webserver in c. !Experimental! + +Deployment: + +Docker and Heroku deployment are supported. To do Heroku deployment use https://github.com/heroku/heroku-buildpack-c buildpack. For Docker just build container image and run it exposing port: + +docker build -t c-dmitriy.icu . +docker run -dp 5000:5000 c-dmitriy.icu \ No newline at end of file