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

42 lines
940 B
Text
Raw Permalink Normal View History

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