-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
39 lines (29 loc) · 1.06 KB
/
Dockerfile
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
# This is a multi-stage Dockerfile and requires >= Docker 17.05
# https://docs.docker.com/engine/userguide/eng-image/multistage-build/
##
# NOTE
# this repo can be easily built with the
# FROM gobuffalo/buffalo:v0.14.0 as builder
# but the database will be missing
# I cannot share the database because I do not have the right to distribute
FROM gcr.io/worldlocation-io/worldlocations-db:v0.0.2 as builder
RUN mkdir -p $GOPATH/src/worldlocations
WORKDIR $GOPATH/src/worldlocations
RUN mkdir /app_src
ADD . .
RUN go get $(go list ./... | grep -v /vendor/)
RUN buffalo build --static -o /app_src/app
FROM alpine
RUN apk add --no-cache bash
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache wget
WORKDIR /app_src
COPY --from=builder /app_src .
COPY --from=builder /var/databases /var/databases
# Uncomment to run the binary in "production" mode:
# Bind the app to 0.0.0.0 so it can be seen from outside the container
ENV ADDR=0.0.0.0
EXPOSE 8080
# Uncomment to run the migrations before running the binary:
# CMD /bin/app migrate; /bin/app
CMD exec /app_src/app;