-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathDockerfile
31 lines (25 loc) · 980 Bytes
/
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
FROM concourse/golang-builder as builder
COPY . /src
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates apt-transport-https software-properties-common gpg-agent
# install Node 12.x
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get update && apt-get install -y nodejs
# install Yarn for web UI tests
RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN add-apt-repository "deb https://dl.yarnpkg.com/debian/ stable main"
RUN apt-get update && apt-get -y install yarn
WORKDIR /src/warehouse/web
RUN yarn install && yarn build
WORKDIR /src/warehouse
ENV CGO_ENABLED 0
RUN go get -d ./...
RUN go build -o dutyfree ./main.go
FROM ubuntu:bionic AS dutyfree
EXPOSE 9090
COPY --from=builder src/warehouse/dutyfree /usr/local/bin/
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates
RUN chmod +x /usr/local/bin/dutyfree
FROM dutyfree
ENTRYPOINT ["dutyfree"]