-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
40 lines (36 loc) · 943 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
32
33
34
35
36
37
38
39
40
FROM node:14-alpine AS node
LABEL maintainer="Goavega Open Source Team <[email protected]>"
ENV BUILD_DIR /home/
RUN set -ex && \
apk add yarn
COPY ./ ${BUILD_DIR}
WORKDIR ${BUILD_DIR}client
RUN set -ex && \
yarn install && \
yarn prod
FROM golang:1.14-alpine AS go
ENV APP_DIR /var/www/
ENV BUILD_DIR /home/
RUN set -ex && \
mkdir -p ${APP_DIR}js/ && \
mkdir -p ${APP_DIR}css/ && \
mkdir -p ${APP_DIR}views/
COPY --from=node /home/js/* ${APP_DIR}js/
COPY --from=node /home/css/* ${APP_DIR}css/
COPY --from=node /home/views/* ${APP_DIR}views/
COPY ./ ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN set -ex && \
go build ./ && \
cp ./mustard ${APP_DIR}
FROM alpine:latest
ENV APP_DIR /var/www/
ENV PORT 80
COPY --from=go ${APP_DIR} ${APP_DIR}
COPY ./dockersupport/start.sh /usr/local/bin/
WORKDIR ${APP_DIR}
RUN set -ex && \
chmod u+x ./mustard && \
chmod u+x /usr/local/bin/start.sh
EXPOSE ${PORT}
CMD ["start.sh"]