Fieldnotes app backend

Dockerfile 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. FROM golang:1.11 AS builder
  2. RUN apt-get update -y && apt-get -y install git-core curl build-essential
  3. COPY ./ /src
  4. WORKDIR /src
  5. RUN go clean -v
  6. RUN make bin/server
  7. FROM alpine:3.8
  8. ARG HTTP_PROXY=
  9. ARG HTTPS_PROXY=
  10. ARG http_proxy=
  11. ARG https_proxy=
  12. RUN echo "@edge http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories; \
  13. echo "@edgecommunity http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \
  14. echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories;
  15. RUN apk add --no-cache bash libcrypto1.1@edge gdal@testing
  16. RUN adduser -S fieldnotes-server
  17. COPY misc/dokku/app.json "/app/app.json"
  18. COPY misc/dokku/Procfile "/app/Procfile"
  19. COPY --from=builder /src/bin/server /app/bin/server
  20. COPY static /app/static
  21. COPY template /app/template
  22. COPY schema /app/schema
  23. COPY data /data
  24. RUN chmod +x /app/bin/*
  25. RUN chown -R fieldnotes-server: /app\
  26. && mkdir -p /data\
  27. && chown -R fieldnotes-server: /data\
  28. && mkdir -p /tiff\
  29. && chown -R fieldnotes-server: /tiff
  30. USER fieldnotes-server
  31. EXPOSE 3000
  32. VOLUME /tiff
  33. VOLUME /data
  34. ENV FIELDNOTES_USERNAME=
  35. ENV FIELDNOTES_PASSWORD=
  36. WORKDIR /app
  37. CMD ["./bin/server", "-tiff", "/tiff", "-nomenclature", "/data/nomenclatures.json"]