From ad92a7ebba3e60c66644ce4ecc30f00f7a2c730b Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Sat, 30 Apr 2022 20:13:39 -0400 Subject: [PATCH] Add docker --- Dockerfile | 23 +++++++++++++++++++++++ docker-compose.yml | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..49e6fae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:latest AS build + +RUN apt-get update && apt-get install -y curl build-essential git libboost-all-dev +RUN curl https://github.com/CrowCpp/Crow/releases/download/v1.0%2B2/crow-v1.0+2.deb -o crow.deb -L +RUN apt-get purge -y curl +RUN apt install -y ./crow.deb + +WORKDIR /work +COPY ./ ./ +RUN make clean && make + + + +FROM ubuntu:latest +#WORKDIR /opt/proc-api +COPY --from=build /work/bin/proc-api ./ + +ENV PORT="5000" +ENV NAME="proc-api" +ENV THREADS="2" +ENV AUTH="" + +CMD ./proc-api -p $PORT -n $NAME -t $THREADS $(if [ -z $AUTH ]; then echo ""; else echo "-a $AUTH"; fi) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..10406db --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +# NOTE: This is a sample docker-compose for how you could set up your own set +# of containers +version: '3' +services: + proc-api_service: + image: proc-api + container_name: proc-api_service + restart: unless-stopped + ports: + - 5000:5000 + - 6123:6123 + environment: + - PORT=6123 + - NAME="My Cool Service" + - THREADS=4 + #-AUTH="./auth.txt" + #NOTE for auth to work, you will need to mount a volume with the authfile + #in it + +