Update dockerfile to match the latest version

This commit is contained in:
Jussi Räsänen 2024-05-19 15:48:51 +03:00
parent 178e23738d
commit b0895a7a59
No known key found for this signature in database
GPG key ID: 973AC6ACBE3D307D

View file

@ -14,25 +14,33 @@
## You should have received a copy of the GNU General Public License ## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
ARG GOLANG_VERSION=1.21 ARG GOLANG_VERSION=1.22
# Build image # Build image
FROM golang:${GOLANG_VERSION}-alpine as build FROM golang:${GOLANG_VERSION}-alpine as build
ARG WRITEFREELY_VERSION=v0.14.0 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."
ARG WRITEFREELY_VERSION=v0.15.0
ARG WRITEFREELY_FORK=writeas/writefreely ARG WRITEFREELY_FORK=writeas/writefreely
RUN apk add --update nodejs npm make g++ git sqlite-dev RUN apk -U upgrade \
&& apk add --no-cache nodejs npm make g++ git sqlite-dev \
&& npm install -g less less-plugin-clean-css \
&& mkdir -p /go/src/github.com/writefreely/writefreely
RUN npm install -g less less-plugin-clean-css 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/${WRITEFREELY_FORK} RUN mkdir -p /go/src/github.com/${WRITEFREELY_FORK}
RUN git clone https://github.com/${WRITEFREELY_FORK}.git /go/src/github.com/${WRITEFREELY_FORK} -b ${WRITEFREELY_VERSION} RUN git clone https://github.com/${WRITEFREELY_FORK}.git /go/src/github.com/${WRITEFREELY_FORK} -b ${WRITEFREELY_VERSION}
WORKDIR /go/src/github.com/${WRITEFREELY_FORK} WORKDIR /go/src/github.com/${WRITEFREELY_FORK}
ENV GO111MODULE=on ENV GO111MODULE=on
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN make build \ RUN make build \
&& make ui && make ui
RUN mkdir /stage && \ RUN mkdir /stage && \
cp -R /go/bin \ cp -R /go/bin \
/go/src/github.com/${WRITEFREELY_FORK}/templates \ /go/src/github.com/${WRITEFREELY_FORK}/templates \
@ -44,14 +52,18 @@ RUN mkdir /stage && \
mv /stage/cmd/writefreely/writefreely /stage mv /stage/cmd/writefreely/writefreely /stage
# Final image # Final image
FROM alpine:3.18 FROM alpine:3.19
RUN apk add --no-cache openssl ca-certificates RUN apk -U upgrade && apk add --no-cache openssl ca-certificates
COPY --from=build --chown=daemon:daemon /stage /writefreely COPY --from=build --chown=daemon:daemon /stage /writefreely
COPY bin/writefreely-docker.sh /writefreely/ COPY bin/writefreely-docker.sh /writefreely/
WORKDIR /writefreely WORKDIR /writefreely
VOLUME /data VOLUME /data
EXPOSE 8080 EXPOSE 8080
USER daemon
ENTRYPOINT ["/writefreely/writefreely-docker.sh"] ENTRYPOINT ["/writefreely/writefreely-docker.sh"]
HEALTHCHECK --start-period=5s --interval=15s --timeout=5s \
CMD curl -fSs http://localhost:8080/ || exit 1