Add file volume to the docker image
This commit is contained in:
14
Dockerfile
14
Dockerfile
@ -15,22 +15,28 @@ RUN apk --no-cache add build-base git
|
||||
COPY . ${GOPATH}/src/code.vikunja.io/api
|
||||
WORKDIR ${GOPATH}/src/code.vikunja.io/api
|
||||
|
||||
#Checkout version if set
|
||||
# Checkout version if set
|
||||
RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \
|
||||
&& make clean generate build
|
||||
|
||||
###################
|
||||
# The actual image
|
||||
# Note: I wanted to use the scratch image here, but unfortunatly the go-sqlite bindings require cgo and
|
||||
# for whatever reason, the container would not start when I compiled the image without cgo.
|
||||
# because of this, the container would not start when I compiled the image without cgo.
|
||||
FROM alpine:3.9
|
||||
LABEL maintainer="maintainers@vikunja.io"
|
||||
|
||||
WORKDIR /app/vikunja/
|
||||
COPY --from=build-env /go/src/code.vikunja.io/api/vikunja .
|
||||
RUN chown nobody:nogroup -R /app/vikunja
|
||||
RUN adduser -S -D vikunja -h /app/vikunja -H \
|
||||
&& chown vikunja -R /app/vikunja
|
||||
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
|
||||
|
||||
USER nobody:nogroup
|
||||
# Files permissions
|
||||
RUN mkdir /app/vikunja/files && \
|
||||
chown -R vikunja /app/vikunja/files
|
||||
VOLUME /app/vikunja/files
|
||||
|
||||
USER vikunja
|
||||
CMD ["/app/vikunja/vikunja"]
|
||||
EXPOSE 3456
|
||||
|
Reference in New Issue
Block a user