mirror of
https://github.com/jrasanen/writefreely-docker.git
synced 2025-05-08 23:26:02 +03:00
Add .env instructions for docker compose
This commit is contained in:
parent
6047684086
commit
ee44d5dba8
3 changed files with 48 additions and 5 deletions
47
README.md
47
README.md
|
@ -73,7 +73,46 @@ git clone https://github.com/yourusername/writefreely-docker.git
|
||||||
cd writefreely-docker
|
cd writefreely-docker
|
||||||
```
|
```
|
||||||
|
|
||||||
#### MariaDB
|
#### Prepare the Data Directory
|
||||||
|
|
||||||
|
Create the data directory and assign the appropriate permissions:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir data
|
||||||
|
sudo chown 1000:1000 data
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Configure the Environment
|
||||||
|
|
||||||
|
Before starting the services, you need to copy the appropriate .env file and edit it to configure the environment variables, especially the passwords.
|
||||||
|
|
||||||
|
##### For MariaDB
|
||||||
|
|
||||||
|
Copy the .env.mariadb file to .env:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.mariadb .env
|
||||||
|
```
|
||||||
|
|
||||||
|
##### For SQLite
|
||||||
|
|
||||||
|
Copy the .env.sqlite file to .env:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.sqlite .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, edit the .env file to set the appropriate values for your environment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Ensure to set secure passwords and other necessary configuration options.
|
||||||
|
|
||||||
|
#### Start the Services
|
||||||
|
|
||||||
|
##### MariaDB
|
||||||
|
|
||||||
To use the **MariaDB** configuration, run:
|
To use the **MariaDB** configuration, run:
|
||||||
|
|
||||||
|
@ -81,7 +120,7 @@ To use the **MariaDB** configuration, run:
|
||||||
docker-compose -f docker-compose.mariadb.yaml up
|
docker-compose -f docker-compose.mariadb.yaml up
|
||||||
```
|
```
|
||||||
|
|
||||||
#### SQLite
|
##### SQLite
|
||||||
|
|
||||||
To use the **SQLite** configuration, run:
|
To use the **SQLite** configuration, run:
|
||||||
|
|
||||||
|
@ -98,3 +137,7 @@ docker build -t yourusername/writefreely .
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `yourusername` with your Docker Hub username or a suitable image name.
|
Replace `yourusername` with your Docker Hub username or a suitable image name.
|
||||||
|
|
||||||
|
### Contributing
|
||||||
|
|
||||||
|
Contributions are welcome! Please fork this repository and submit pull requests for any enhancements or bug fixes.
|
||||||
|
|
|
@ -6,7 +6,7 @@ services:
|
||||||
context: .
|
context: .
|
||||||
init: true
|
init: true
|
||||||
env_file:
|
env_file:
|
||||||
- .env.mariadb
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
ports:
|
ports:
|
||||||
|
@ -22,7 +22,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./db-data:/var/lib/mysql
|
- ./db-data:/var/lib/mysql
|
||||||
env_file:
|
env_file:
|
||||||
- .env.mariadb
|
- .env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "mariadb-admin ping -h localhost -u${MARIADB_USER} -p${MARIADB_PASSWORD} || exit 1"]
|
test: ["CMD-SHELL", "mariadb-admin ping -h localhost -u${MARIADB_USER} -p${MARIADB_PASSWORD} || exit 1"]
|
||||||
|
|
|
@ -6,7 +6,7 @@ services:
|
||||||
context: .
|
context: .
|
||||||
init: true
|
init: true
|
||||||
env_file:
|
env_file:
|
||||||
- .env.sqlite
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
ports:
|
ports:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue