From e882fbe6adf27a7b099dfbfd4c6738d75012eec6 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 8 Sep 2018 15:08:33 +0200 Subject: [PATCH] Added dockerfile --- .drone.yml | 10 ++++++++++ Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml index 5b95441dc..ba9857c08 100644 --- a/.drone.yml +++ b/.drone.yml @@ -105,6 +105,16 @@ pipeline: when: event: [tag, push] + docker: + image: plugins/docker + pull: true + secrets: [ docker_username, docker_password ] + repo: vikunja/api + auto_tag: true + when: + event: [ push, tag ] + branch: [ master ] + # Push the releases to our pseudo-s3-bucket release: image: plugins/s3:1 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..c7870f450 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ + +################################### +#Build stage +FROM golang:1.11-alpine3.7 AS build-env + +ARG VIKUNJA_VERSION +ENV TAGS "sqlite" + +#Build deps +RUN apk --no-cache add build-base + +#Setup repo +COPY . ${GOPATH}/src/code.vikunja.io/vikunja +WORKDIR ${GOPATH}/src/code.vikunja.io/vikunja + +#Checkout version if set +RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \ + && make clean generate build + +FROM alpine:3.7 +LABEL maintainer="maintainers@vikunja.io" + +EXPOSE 3456 + +RUN apk --no-cache add \ + bash \ + ca-certificates \ + curl \ + gettext \ + linux-pam \ + openssh \ + s6 \ + sqlite \ + su-exec \ + tzdata + +ENTRYPOINT ["/usr/bin/entrypoint"] +CMD ["/bin/s6-svscan", "/etc/s6"] + +COPY docker / +COPY --from=build-env /go/src/code.vikunja.io/vikunja/vikunja /app/vikunja/vikunja +RUN ln -s /app/vikunja/vikunja /usr/local/bin/vikunja