Add docker compose instructions

This commit is contained in:
Germán Martín 2024-05-29 10:41:24 +02:00
parent 759e8d6736
commit 919f40bfe1
5 changed files with 50 additions and 4 deletions

View file

@ -1 +1,2 @@
data data
db-data

View file

@ -31,6 +31,7 @@ The following variables will be used to construct the `config.ini` on first star
## Database Configuration ## Database Configuration
- **`WRITEFREELY_DATABASE_DATABASE`**: Specifies the type of database used, such as `mysql` or `sqlite3`. - **`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_USERNAME`**: The username for the database.
- **`WRITEFREELY_DATABASE_PASSWORD`**: The password for the database. - **`WRITEFREELY_DATABASE_PASSWORD`**: The password for the database.
- **`WRITEFREELY_DATABASE_NAME`**: The name of the database to connect to. - **`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_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_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 ### Volumes
* `/data`: Directory where WriteFreely stores its data, including database files and configuration. * `/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.

View file

@ -54,7 +54,7 @@ gopher_port = 0
[database] [database]
type = ${WRITEFREELY_DATABASE_DATABASE} type = ${WRITEFREELY_DATABASE_DATABASE}
filename = ${WRITEFREELY_SQLITE_FILENAME} filename = ${WRITEFREELY_SQLITE_FILENAME:-./writefreely.db}
username = ${WRITEFREELY_DATABASE_USERNAME} username = ${WRITEFREELY_DATABASE_USERNAME}
password = ${WRITEFREELY_DATABASE_PASSWORD} password = ${WRITEFREELY_DATABASE_PASSWORD}
database = ${WRITEFREELY_DATABASE_NAME} database = ${WRITEFREELY_DATABASE_NAME}

View file

@ -1,7 +1,7 @@
services: services:
writefreely-web: writefreely-web:
container_name: writefreely-web container_name: writefreely-web
image: gmag11/writefreely:latest image: jrasanen/writefreely:latest
build: build:
context: . context: .
init: true init: true

View file

@ -1,7 +1,7 @@
services: services:
writefreely-web: writefreely-web:
container_name: writefreely-web container_name: writefreely-web
image: gmag11/writefreely:latest image: jrasanen/writefreely:latest
build: build:
context: . context: .
init: true init: true