forked from espebra/filebin2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two stage Dockerfile for atsigncompany/filebin2
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
id: docker_build | ||
uses: docker/[email protected] | ||
with: | ||
file: ./Dockerfile | ||
file: ./Dockerfile.prod | ||
push: true | ||
tags: | | ||
atsigncompany/filebin2:automated | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM golang:buster AS build | ||
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y make gcc libc-dev git | ||
WORKDIR /app | ||
RUN go get -u github.com/jstemmer/go-junit-report | ||
RUN go get -u github.com/GeertJohan/go.rice/rice | ||
COPY . . | ||
RUN go build -tags netgo -ldflags '-extldflags "-static"' | ||
|
||
FROM debian:stable-slim | ||
ENV HOMEDIR=/home/filebin2 | ||
ENV USER_ID=1024 | ||
ENV GROUP_ID=1024 | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install ca-certificates -y && \ | ||
update-ca-certificates && \ | ||
mkdir -p $HOMEDIR && \ | ||
mkdir -p /var/log/filebin && \ | ||
addgroup --gid $GROUP_ID filebin2 && \ | ||
useradd --system --uid $USER_ID --gid $GROUP_ID --shell /bin/bash \ | ||
--home $HOMEDIR filebin2 && \ | ||
chown -R filebin2:filebin2 $HOMEDIR && \ | ||
chown -R filebin2:filebin2 /var/log/filebin | ||
COPY --from=build --chown=filebin2:filebin2 /app/filebin2 \ | ||
/usr/local/bin/filebin2 | ||
WORKDIR $HOMEDIR | ||
USER filebin2 | ||
ENTRYPOINT ["/usr/local/bin/filebin2"] |