2019-01-16 20:05:52 +00:00
# Build image
2023-01-20 11:36:11 +00:00
FROM golang:1.19-alpine as build
2018-11-14 04:24:06 +00:00
2023-09-07 19:46:45 +00:00
LABEL org.opencontainers.image.source= https://github.com/writefreely/writefreely
LABEL org.opencontainers.image.description= "WriteFreely is a clean, minimalist publishing platform made for writers. Start a blog, share knowledge within your organization, or build a community around the shared act of writing."
2021-08-08 20:27:33 +00:00
RUN apk add --update nodejs npm make g++ git
2019-01-16 20:05:52 +00:00
RUN npm install -g less less-plugin-clean-css
2018-11-14 04:24:06 +00:00
2021-04-06 21:24:07 +00:00
RUN mkdir -p /go/src/github.com/writefreely/writefreely
WORKDIR /go/src/github.com/writefreely/writefreely
2020-10-26 13:50:11 +00:00
2018-11-14 04:24:06 +00:00
COPY . .
2023-01-20 11:36:11 +00:00
RUN cat ossl_legacy.cnf > /etc/ssl/openssl.cnf
2019-04-19 10:48:16 +00:00
ENV GO111MODULE = on
2023-01-20 11:36:11 +00:00
ENV NODE_OPTIONS = --openssl-legacy-provider
2020-10-26 13:50:11 +00:00
2019-01-16 20:05:52 +00:00
RUN make build \
2020-10-26 13:50:11 +00:00
&& make ui
2018-11-21 16:38:56 +00:00
RUN mkdir /stage && \
cp -R /go/bin \
2021-04-06 21:24:07 +00:00
/go/src/github.com/writefreely/writefreely/templates \
/go/src/github.com/writefreely/writefreely/static \
/go/src/github.com/writefreely/writefreely/pages \
/go/src/github.com/writefreely/writefreely/keys \
/go/src/github.com/writefreely/writefreely/cmd \
2018-11-22 12:57:05 +00:00
/stage
2018-11-21 16:38:56 +00:00
2019-01-16 20:05:52 +00:00
# Final image
2022-05-25 16:43:13 +00:00
FROM alpine:3
2018-11-21 16:38:56 +00:00
2018-12-05 12:33:13 +00:00
RUN apk add --no-cache openssl ca-certificates
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
2019-04-19 11:05:01 +00:00
ENTRYPOINT [ "cmd/writefreely/writefreely" ]