musala/docker/Dockerfile

39 lines
976 B
Text
Raw Normal View History

2018-12-27 11:49:22 +00:00
##
## stage 1 : Build
##
2019-09-04 07:29:47 +00:00
FROM golang:1.12 AS build
2018-08-22 17:19:21 +00:00
2019-09-04 07:06:05 +00:00
RUN git clone \
--single-branch \
--branch develop \
2019-09-04 15:06:14 +00:00
https://github.com/glenux/musala-mail \
2019-09-04 07:06:05 +00:00
/app \
2019-10-11 10:21:39 +00:00
&& rm -f /app/contrib-trello \
2019-09-04 07:06:05 +00:00
&& git clone \
https://github.com/glenux/contrib-trello \
/app/contrib-trello
# COPY . /app
2018-11-22 16:07:32 +00:00
2018-11-22 16:31:39 +00:00
WORKDIR /app
2019-09-04 07:28:06 +00:00
2019-09-04 07:49:16 +00:00
RUN go get \
2019-09-04 07:28:06 +00:00
&& CGO_ENABLED=0 make build
2018-08-21 07:08:51 +00:00
2018-12-27 11:49:22 +00:00
##
## Stage 2 : Runtime
##
FROM alpine:3.7 AS runtime
2018-08-22 17:19:21 +00:00
RUN apk update \
&& apk add --no-cache dcron tzdata ca-certificates bash \
2018-08-22 17:19:21 +00:00
&& rm -rf /var/cache/apk/*
RUN mkdir /app
2019-09-04 15:06:14 +00:00
COPY --from=build /app/musala-mail /app/
COPY docker/musala-mail.cron /app/
2018-12-27 12:11:44 +00:00
COPY templates/ /app/templates
2018-08-22 17:19:21 +00:00
2019-09-04 15:06:14 +00:00
CMD ["/bin/sh", "-c", "/usr/bin/crontab /app/musala-mail.cron && /usr/sbin/crond -f"]
2018-08-22 17:19:21 +00:00