Dockerfiles

This commit is contained in:
Piyush मिश्रः 2022-01-19 21:46:16 +05:30
parent 69c408a824
commit 5b0eae45ee
4 changed files with 39 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
/target

24
Dockerfile Normal file
View File

@ -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"]

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '2'
services:
lupt:
container_name: lupt-server
build: .
ports:
- "8080:8080"

6
run-lupt.sh Normal file
View File

@ -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