-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from cthit/feat/users
Add user features and other improvements
- Loading branch information
Showing
42 changed files
with
2,622 additions
and
1,214 deletions.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Dockerfile for goldapps production | ||
FROM golang:alpine AS buildStage | ||
FROM golang:1.12-alpine AS buildStage | ||
MAINTAINER digIT <[email protected]> | ||
|
||
# Install git | ||
|
@@ -8,32 +8,40 @@ RUN apk upgrade | |
RUN apk add --update git | ||
|
||
# Copy sources | ||
RUN mkdir -p $GOPATH/src/github.com/cthit/goldapps | ||
COPY . $GOPATH/src/github.com/cthit/goldapps | ||
WORKDIR $GOPATH/src/github.com/cthit/goldapps/cmd | ||
RUN mkdir -p /goldapps | ||
COPY . /goldapps | ||
WORKDIR /goldapps/cmd/goldapps | ||
|
||
# Grab dependencies | ||
RUN go get -d -v ./... | ||
#RUN go get -d -v ./... | ||
|
||
# build binary | ||
RUN go install -v | ||
RUN mkdir /app && mv $GOPATH/bin/cmd /app/goldapps | ||
RUN mkdir /app && mv $GOPATH/bin/goldapps /app/goldapps | ||
|
||
########################## | ||
# PRODUCTION STAGE # | ||
########################## | ||
FROM alpine | ||
MAINTAINER digIT <[email protected]> | ||
|
||
# Add standard certificates | ||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* | ||
|
||
# Set user | ||
RUN addgroup -S app | ||
RUN adduser -S -G app -s /bin/bash app | ||
USER app:app | ||
|
||
# Copy execution script | ||
COPY ./sleep_and_run.sh /app/sleep_and_run.sh | ||
|
||
# Copy binary | ||
COPY --from=buildStage /app/goldapps /app/goldapps | ||
|
||
ENV WAIT 15s | ||
|
||
# Set good defaults | ||
WORKDIR /app | ||
ENTRYPOINT /app/goldapps | ||
ENTRYPOINT ./sleep_and_run.sh | ||
CMD -dry |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.