mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-07-11 14:24:32 +00:00
Refactor build steps
This commit is contained in:
parent
d17efed959
commit
964b024b02
7 changed files with 57 additions and 21 deletions
|
|
@ -1,19 +1,42 @@
|
|||
FROM golang:1.13.6
|
||||
# [ Stage 1] Builder
|
||||
FROM golang:alpine AS builder
|
||||
|
||||
# Set necessary environmet variables needed for our image
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
GOOS=linux \
|
||||
GOARCH=amd64
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
COPY ./app/t2-stats /app
|
||||
|
||||
# Copy and download dependency using go mod
|
||||
RUN go mod download
|
||||
|
||||
|
||||
# # Go Packages
|
||||
# RUN go get -u -v \
|
||||
# # GUID Generator
|
||||
# github.com/rs/xid \
|
||||
# # PostgreSQL Driver
|
||||
# github.com/jackc/pgx \
|
||||
# github.com/jmoiron/sqlx \
|
||||
# # Better Error Handling
|
||||
# github.com/pkg/errors
|
||||
|
||||
RUN go build -o main .
|
||||
|
||||
|
||||
# [ Stage 2]
|
||||
|
||||
FROM golang:alpine
|
||||
|
||||
LABEL maintainer="Anthony Mineo <anthonymineo@gmail.com>"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Go Packages
|
||||
RUN go get -u -v \
|
||||
# GUID Generator
|
||||
github.com/rs/xid \
|
||||
# PostgreSQL Driver
|
||||
github.com/jackc/pgx \
|
||||
github.com/jmoiron/sqlx \
|
||||
# Better Error Handling
|
||||
github.com/pkg/errors
|
||||
COPY --from=builder /app/main /app/main
|
||||
COPY ./app/t2-stats/start.sh /app/start.sh
|
||||
|
||||
COPY ./app/t2-stats /app
|
||||
|
||||
ENTRYPOINT go run main.go
|
||||
ENTRYPOINT ./start.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue