t2-stat-parser/build/go-t2-stat-parser/Dockerfile

42 lines
940 B
Docker
Raw Permalink Normal View History

2020-03-07 16:01:21 +00:00
# [ Stage 1] Builder
2020-03-07 20:08:02 +00:00
FROM golang:1.14-alpine AS builder
2020-03-07 16:01:21 +00:00
# Set necessary environmet variables needed for our image
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
2020-02-06 21:26:32 +00:00
WORKDIR /app
2020-03-07 18:59:09 +00:00
COPY ./app/t2-stat-parser /app
2020-02-06 21:26:32 +00:00
2020-03-07 16:01:21 +00:00
# Copy and download dependency using go mod
RUN go mod download
RUN go build -o main .
# ------------------------------------------
# ------------------------------------------
2020-03-07 16:01:21 +00:00
# [ Stage 2]
2020-03-07 20:08:02 +00:00
FROM golang:1.14-alpine
2020-03-07 16:01:21 +00:00
LABEL maintainer="Anthony Mineo <anthonymineo@gmail.com>"
2021-03-17 00:10:59 +00:00
RUN apk update && apk add --no-cache wget tzdata lftp
#Set TimeZone
ENV TZ=America/New_York
2020-09-23 14:57:09 +00:00
# #Set cron schedule (every day at 11:30am est)
# RUN echo '30 11 * * * /app/start.sh' > /etc/crontabs/root
2020-03-07 16:01:21 +00:00
WORKDIR /app
COPY --from=builder /app/main /app/main
2020-03-07 18:59:09 +00:00
COPY ./app/t2-stat-parser/start.sh /app/start.sh
COPY ./app/t2-stat-parser/parser-daemon.sh /app/parser-daemon.sh
2020-03-07 16:01:21 +00:00
2020-09-23 14:57:09 +00:00
#ENTRYPOINT ./parser-daemon.sh
ENTRYPOINT ./start.sh