Add docker support

Based on alpine image, runs as a regular user
This commit is contained in:
Ilya Glotov 2017-07-28 12:12:44 +03:00
parent 5d350247b6
commit c8d367c97f
No known key found for this signature in database
GPG Key ID: AE18CC224730A36D
1 changed files with 25 additions and 0 deletions

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
FROM alpine:edge
COPY ./ /tmp
WORKDIR /tmp
RUN apk update \
&& apk add --no-cache ca-certificates \
libressl \
llvm-libunwind \
&& apk add --no-cache --virtual .build-rust \
rust \
cargo \
libressl-dev \
&& cargo build --release \
&& mv target/release/iptoasn-webservice /usr/bin/iptoasn-webservice \
&& rm -rf ~/.cargo \
/var/cache/apk/* \
/tmp/* \
&& apk del .build-rust
RUN adduser -D app
USER app
ENTRYPOINT /usr/bin/iptoasn-webservice --listen 0.0.0.0:10000