forked from shanepeckham/captureorderack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.no
45 lines (33 loc) · 1.07 KB
/
Dockerfile.no
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM golang:1.8.3-alpine3.6
ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH
RUN cd
WORKDIR src/hackcaptureorder
# Run a gofmt and exclude all vendored code.
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }
RUN CGO_ENABLED=0 GOOS=linux GOARCH=386 go build
FROM alpine:3.6
RUN apk --no-cache add ca-certificates
# Add non root user
RUN addgroup -S app && adduser -S -g app app
RUN mkdir -p /go/src/github.com/shanepeckham/captureorderack/
RUN chown app /go/src/github.com/shanepeckham/captureorderack/
WORKDIR /go/src/github.com/shanepeckham/captureorderack/
# Copy the application files (needed for production)
COPY . .
USER app
# EH
ENV EVENTURL=
ENV EVENTPOLICYNAME=
ENV EVENTPOLICYKEY=
# ACK Logging
ENV TEAMNAME=
# Mongo/Cosmos
ENV MONGOHOST=
# RabbitMQ
ENV RABBITMQHOST=
# Expose the application on port 8080
EXPOSE 8080
# Set the entry point of the container to the bee command that runs the
# application and watches for changes
CMD ["./hackcaptureorder"]