2018-11-21 16:38:56 +00:00
|
|
|
FROM golang:1.11.2-alpine3.8 as build
|
2018-11-14 04:24:06 +00:00
|
|
|
|
|
|
|
RUN apk add --update nodejs nodejs-npm make git
|
|
|
|
RUN npm install -g less
|
|
|
|
RUN npm install -g less-plugin-clean-css
|
|
|
|
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN make install
|
|
|
|
RUN make ui
|
|
|
|
RUN make deps
|
|
|
|
|
2018-11-21 16:38:56 +00:00
|
|
|
RUN mkdir /stage && \
|
|
|
|
cp -R /go/bin \
|
|
|
|
/go/src/app/templates \
|
|
|
|
/go/src/app/static \
|
|
|
|
/go/src/app/schema.sql \
|
|
|
|
/go/src/app/pages \
|
|
|
|
/go/src/app/keys \
|
2018-11-22 12:57:05 +00:00
|
|
|
/stage
|
2018-11-21 16:38:56 +00:00
|
|
|
|
2018-11-21 18:51:37 +00:00
|
|
|
FROM alpine:3.8
|
2018-11-21 16:38:56 +00:00
|
|
|
|
|
|
|
COPY --from=build --chown=daemon:daemon /stage /go
|
|
|
|
|
2018-11-21 18:51:37 +00:00
|
|
|
WORKDIR /go
|
2018-11-21 16:38:56 +00:00
|
|
|
VOLUME /go/keys
|
2018-11-14 04:24:06 +00:00
|
|
|
EXPOSE 8080
|
2018-11-21 16:38:56 +00:00
|
|
|
USER daemon
|
|
|
|
|
2018-11-21 18:51:37 +00:00
|
|
|
CMD ["bin/writefreely"]
|