diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c41cc9e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5520e10 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM rust:1.58-alpine as builder + +ENV PATH="/app/bin:${PATH}" + +RUN mkdir -pv /app +COPY ./Cargo.toml /app +COPY ./Cargo.lock /app +COPY ./config.json /app +COPY ./run-lupt.sh /app/bin/run-lupt.sh +COPY ./src /app/src +COPY ./static /app/static + +RUN apk upgrade --update-cache --available +RUN apk add musl-dev openssl-dev + +WORKDIR /app + +RUN cargo build +RUN cp -v target/debug/lupt bin +RUN cargo clean + +RUN chmod 755 bin/run-lupt.sh + +CMD ["run-lupt.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..686fd88 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2' + +services: + lupt: + container_name: lupt-server + build: . + ports: + - "8080:8080" diff --git a/run-lupt.sh b/run-lupt.sh new file mode 100644 index 0000000..d2b024b --- /dev/null +++ b/run-lupt.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +echo => Starting lupt server +/app/bin/lupt --config-file /app/config.json --static_path /app/static --bind_address 0.0.0.0 --port 8080