some more tweaks and fixes

This commit is contained in:
2020-01-15 18:00:58 +01:00
parent a09cb9c1cd
commit 35de12b3e9
6 changed files with 69 additions and 36 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
############################
# STEP 1 build executable binary
############################
FROM golang:alpine AS builder
# Install git.
# Git is required for fetching the dependencies.
RUN apk update && \
apk add --no-cache ca-certificates pkgconf git libxml2-dev oniguruma-dev && \
apk add --virtual build-dependencies build-base gcc wget git && \
mkdir -p /opt/build
WORKDIR /opt/build
COPY . .
# Fetch dependencies.
# Using go get.
RUN go get -d -v
# Build the binary.
RUN go build -o /go/bin/fbBot .
############################
# STEP 2 build a small image
############################
FROM alpine
VOLUME /opt/tmp
RUN apk update && \
apk add --no-cache ca-certificates chromium chromium-chromedriver
# Copy our static executable.
COPY --from=builder /go/bin/fbBot /opt/fbBot
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY contrib/ /
COPY config.yaml /etc/fbBot/config.yaml
# Run the hello binary.
ENTRYPOINT ["/opt/fbBot"]