Add enhanced configuration and Docker Compose support for WriteFreely (#2)

* Update ini configuration. Add docker-compose examples
* remove unneeded network config
* Add docker compose instructions
* Correct sqlite location
* do not wait for MariaDB
* Use writefreely user
* Add .env instructions for docker compose
* Retry init if database is not ready
* Ignore production directories
* Improve init checks
* refactor init script

---------

Co-authored-by: Germán Martín <gmartin@gmartin.net>
This commit is contained in:
Germán Martín 2024-06-12 11:59:37 +02:00 committed by GitHub
parent 0f4b06fa8f
commit a15d4e58cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 399 additions and 41 deletions

View file

@ -7,7 +7,7 @@ LABEL org.opencontainers.image.source="https://github.com/writefreely/writefreel
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=writefreely/writefreely
RUN apk -U upgrade \
&& apk add --no-cache nodejs npm make g++ git sqlite-dev \
@ -38,14 +38,23 @@ RUN mkdir /stage && \
# Final image
FROM alpine:3.19
ARG WRITEFREELY_UID=1000
ARG WRITEFREELY_GID=1000
RUN apk -U upgrade && apk add --no-cache openssl ca-certificates
RUN addgroup -g ${WRITEFREELY_GID} -S writefreely && adduser -u ${WRITEFREELY_UID} -S -G writefreely writefreely
COPY --from=build --chown=daemon:daemon /stage /writefreely
COPY bin/writefreely-docker.sh /writefreely/
WORKDIR /writefreely
VOLUME /data
EXPOSE 8080
USER daemon
RUN chown -R writefreely:writefreely /writefreely
USER writefreely
ENTRYPOINT ["/writefreely/writefreely-docker.sh"]