2018-11-21 17:38:56 +01:00
|
|
|
FROM golang:1.11.2-alpine3.8 as build
|
2018-11-14 05:24:06 +01: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 17:38:56 +01: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 \
|
|
|
|
/stage && ls -l /stage
|
|
|
|
|
2018-11-21 19:51:37 +01:00
|
|
|
FROM alpine:3.8
|
2018-11-21 17:38:56 +01:00
|
|
|
|
|
|
|
COPY --from=build --chown=daemon:daemon /stage /go
|
|
|
|
|
2018-11-21 19:51:37 +01:00
|
|
|
WORKDIR /go
|
2018-11-21 17:38:56 +01:00
|
|
|
VOLUME /go/keys
|
2018-11-14 05:24:06 +01:00
|
|
|
EXPOSE 8080
|
2018-11-21 17:38:56 +01:00
|
|
|
USER daemon
|
|
|
|
|
2018-11-21 19:51:37 +01:00
|
|
|
CMD ["bin/writefreely"]
|