writefreely/Dockerfile

36 lines
914 B
Docker
Raw Normal View History

# Build image
2020-02-15 16:27:13 +01:00
FROM golang:1.13-alpine as build
RUN apk add --update nodejs nodejs-npm make g++ git sqlite-dev
RUN npm install -g less less-plugin-clean-css
RUN go get -u github.com/jteeuwen/go-bindata/...
RUN mkdir -p /go/src/github.com/writeas/writefreely
WORKDIR /go/src/github.com/writeas/writefreely
COPY . .
ENV GO111MODULE=on
RUN make build \
&& make ui
RUN mkdir /stage && \
cp -R /go/bin \
/go/src/github.com/writeas/writefreely/templates \
/go/src/github.com/writeas/writefreely/static \
/go/src/github.com/writeas/writefreely/pages \
/go/src/github.com/writeas/writefreely/keys \
2019-04-19 13:05:01 +02:00
/go/src/github.com/writeas/writefreely/cmd \
/stage
# Final image
2020-02-15 16:27:13 +01:00
FROM alpine:3.11
RUN apk add --no-cache openssl ca-certificates
COPY --from=build --chown=daemon:daemon /stage /go
WORKDIR /go
VOLUME /go/keys
EXPOSE 8080
USER daemon
2019-04-19 13:05:01 +02:00
ENTRYPOINT ["cmd/writefreely/writefreely"]