-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
20 lines (19 loc) · 894 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM golang:alpine as builder
RUN mkdir -p /go/src/notificationservice
ENV SOCIAL_TECH_ENV=local
RUN apk update && apk upgrade && apk add git && export GOOS=linux && export GOARCH=amd64
RUN apk update && apk upgrade && apk --no-cache add ca-certificates && update-ca-certificates
WORKDIR /go/src/notificationservice
COPY . .
RUN go build -o /compiled/notificationservice && mkdir -p /compiled/configs
COPY ./configs /compiled/configs
FROM alpine:latest
RUN mkdir -p /go/src/userservice && chmod -R 0777 /go/* && apk add --no-cache bash && apk add --no-cache tzdata
RUN apk update && apk upgrade && apk --no-cache add ca-certificates && update-ca-certificates
COPY --from=builder /compiled/ /go/src/notificationservice
WORKDIR /go/src/notificationservice/
RUN chmod +x notificationservice
ENV PATH="/go/src/notificationservice"
ENV SOCIAL_TECH_ENV=local
EXPOSE 8081
CMD ["notificationservice"]