1
0
Fork 0
dri/Dockerfile

42 lines
798 B
Docker
Raw Normal View History

2018-09-26 23:04:26 +08:00
FROM node:10-alpine as build
# args
ARG version="0.1.0"
ARG repo="github.com/productionwentdown/dri"
2018-09-27 00:02:26 +08:00
ENV VUE_APP_VERSION=${version}
ENV VUE_APP_SOURCE_LINK="https://${repo}"
2018-09-26 23:04:26 +08:00
# dependencies
2019-06-16 09:16:24 +08:00
RUN apk add --no-cache git
2018-09-26 23:04:26 +08:00
# source
WORKDIR /app
COPY . .
# build
RUN yarn install
RUN yarn build
2018-09-27 13:43:05 +08:00
FROM productionwentdown/caddy:0.11.0 as caddy
2018-09-26 23:04:26 +08:00
FROM alpine:3.8
ARG version
# labels
2018-09-27 00:02:26 +08:00
LABEL org.label-schema.vcs-url="https://github.com/productionwentdown/dri"
2018-09-26 23:04:26 +08:00
LABEL org.label-schema.version=${version}
LABEL org.label-schema.schema-version="1.0"
# copy build output
COPY --from=build /app/dist /srv
# copy caddy
2018-09-27 13:43:05 +08:00
COPY --from=caddy /bin/caddy /usr/local/bin/caddy
2018-09-26 23:04:26 +08:00
# copy entrypoint.sh
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
CMD ["caddy", "-conf", "/etc/Caddyfile"]