diff --git a/.dockerignore b/.dockerignore index 1269488..084065d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ data +db-data diff --git a/README.md b/README.md index 4de4e38..59bc2f7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This project builds a Docker image for [WriteFreely](https://github.com/writefreely/writefreely), a minimalist, privacy-focused, and federated blogging platform. The image is uses on Alpine Linux. -## Getting s tarted +## Getting started To get started, the easiest way to test it out is running the following command: @@ -31,6 +31,7 @@ The following variables will be used to construct the `config.ini` on first star ## Database Configuration - **`WRITEFREELY_DATABASE_DATABASE`**: Specifies the type of database used, such as `mysql` or `sqlite3`. +- **`WRITEFREELY_SQLITE_FILENAME`**: (Optional) DB filename if `sqlite3` detabase is selected. Defaults to `/data/writefreely.db`. - **`WRITEFREELY_DATABASE_USERNAME`**: The username for the database. - **`WRITEFREELY_DATABASE_PASSWORD`**: The password for the database. - **`WRITEFREELY_DATABASE_NAME`**: The name of the database to connect to. @@ -50,6 +51,50 @@ The following variables will be used to construct the `config.ini` on first star - **`WRITEFREELY_LOCAL_TIMELINE`**: Whether or not the instance reader (and the Public option on blogs) is enabled - **`WRITEFREELY_USER_INVITES`**: Who is allowed to send user invites, if anyone. A blank value disables invites for all users. Valid choices: empty, user, or admin +## Writefreely Users + +- **`WRITEFREELY_ADMIN_USER`**: Administrator user name. In single user instances is editor too. +- **`WRITEFREELY_ADMIN_PASSWORD`**: Administrator password + ### Volumes * `/data`: Directory where WriteFreely stores its data, including database files and configuration. + +### Using Docker Compose + +You can use Docker Compose to set up WriteFreely with different database configurations. The configuration files are already included in this repository. Follow the steps below to start the services. + +#### Clone the Repository + +First, clone this repository: + +```bash +git clone https://github.com/yourusername/writefreely-docker.git +cd writefreely-docker +``` + +#### MariaDB + +To use the **MariaDB** configuration, run: + +```bash +docker-compose -f docker-compose.mariadb.yaml up +``` + +#### SQLite + +To use the **SQLite** configuration, run: + +```bash +docker-compose -f docker-compose.sqlite3.yaml up +``` + +### Building the Image + +If you want to build the image yourself, clone this repository and run the following command inside the repository's directory: + +```bash +docker build -t yourusername/writefreely . +``` + +Replace `yourusername` with your Docker Hub username or a suitable image name. diff --git a/bin/writefreely-docker.sh b/bin/writefreely-docker.sh index 3d2da96..bae3b94 100755 --- a/bin/writefreely-docker.sh +++ b/bin/writefreely-docker.sh @@ -54,7 +54,7 @@ gopher_port = 0 [database] type = ${WRITEFREELY_DATABASE_DATABASE} -filename = ${WRITEFREELY_SQLITE_FILENAME} +filename = ${WRITEFREELY_SQLITE_FILENAME:-./writefreely.db} username = ${WRITEFREELY_DATABASE_USERNAME} password = ${WRITEFREELY_DATABASE_PASSWORD} database = ${WRITEFREELY_DATABASE_NAME} diff --git a/docker-compose.mariadb.yaml b/docker-compose.mariadb.yaml index 58140ea..e9c9a75 100644 --- a/docker-compose.mariadb.yaml +++ b/docker-compose.mariadb.yaml @@ -1,7 +1,7 @@ services: writefreely-web: container_name: writefreely-web - image: gmag11/writefreely:latest + image: jrasanen/writefreely:latest build: context: . init: true diff --git a/docker-compose.sqlite3.yaml b/docker-compose.sqlite3.yaml index 882153f..908e07b 100644 --- a/docker-compose.sqlite3.yaml +++ b/docker-compose.sqlite3.yaml @@ -1,7 +1,7 @@ services: writefreely-web: container_name: writefreely-web - image: gmag11/writefreely:latest + image: jrasanen/writefreely:latest build: context: . init: true