vikunja-api/Dockerfile

46 lines
1.3 KiB
Text
Raw Normal View History

2018-09-08 15:08:33 +02:00
2019-06-02 16:37:10 +02:00
##############
# Build stage
FROM vikunja/golang-build AS build-env
2018-09-08 15:08:33 +02:00
ARG VIKUNJA_VERSION
2019-06-02 16:37:10 +02:00
# Setup repo
COPY . /go/src/code.vikunja.io/api
WORKDIR /go/src/code.vikunja.io/api
2018-09-08 15:08:33 +02:00
2019-11-24 18:36:43 +01:00
# Checkout version if set
2018-09-08 15:08:33 +02:00
RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \
&& mage build:clean build
2018-09-08 15:08:33 +02:00
2019-06-02 16:37:10 +02:00
###################
# The actual image
# Note: I wanted to use the scratch image here, but unfortunatly the go-sqlite bindings require cgo and
2019-11-24 18:36:43 +01:00
# because of this, the container would not start when I compiled the image without cgo.
# We're using debian as a base image here because the latest alpine image does not work with arm.
FROM debian:buster-slim
2018-09-08 15:08:33 +02:00
LABEL maintainer="maintainers@vikunja.io"
2019-06-02 16:37:10 +02:00
WORKDIR /app/vikunja/
COPY --from=build-env /go/src/code.vikunja.io/api/vikunja .
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
# Dynamic permission changing stuff
ENV PUID 1000
ENV PGID 1000
RUN addgroup --gid ${PGID} vikunja && \
chown ${PUID} -R /app/vikunja && \
useradd --shell /bin/sh --gid vikunja --uid ${PUID} --home-dir /app/vikunja vikunja
COPY run.sh /run.sh
# Fix time zone settings not working
RUN apt-get update && apt-get install -y tzdata && apt-get clean
2019-11-24 18:36:43 +01:00
# Files permissions
RUN mkdir /app/vikunja/files && \
chown -R vikunja /app/vikunja/files
VOLUME /app/vikunja/files
CMD ["/run.sh"]
2019-06-02 16:37:10 +02:00
EXPOSE 3456