mirror of
https://github.com/SinTan1729/chhoto-url.git
synced 2025-12-05 21:10:23 -08:00
docs: Use directory for mounting
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -2,11 +2,6 @@
|
||||
actix/target
|
||||
resources-final
|
||||
|
||||
# Ignore SQLite file
|
||||
*.sqlite
|
||||
*.sqlite-wal
|
||||
*.sqlite-shm
|
||||
|
||||
# Ignore irrelevant dotfiles
|
||||
.vscode/
|
||||
**/.directory
|
||||
@@ -17,3 +12,4 @@ cookie*
|
||||
|
||||
# Testing related
|
||||
custom_dir
|
||||
testing-data
|
||||
|
||||
@@ -21,9 +21,9 @@ You can use the provided compose file as a base, modifying it as needed. Run it
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
If you're using a custom location for the `db_url`, make sure to make that file
|
||||
before running the docker image, as otherwise a directory will be created in its
|
||||
place, resulting in possibly unwanted behavior.
|
||||
If you're using a custom location for the `db_url`, make sure to mount a whole
|
||||
directory instead of a folder. Chhoto URL uses WAL journaling mode, so if this is
|
||||
not done, there will be a low, but non-zero chance of data corruption.
|
||||
|
||||
## Building and running with docker
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -29,7 +29,7 @@ audit:
|
||||
cargo audit --file actix/Cargo.lock
|
||||
|
||||
docker-test: docker-local docker-stop test
|
||||
docker run -t -p ${port}:${port} --name chhoto-url --env-file ./.env -v "${db_file}:${db_url}" -d chhoto-url
|
||||
docker run -t -p ${port}:${port} --name chhoto-url --env-file ./.env -v "${db_dir}:/data" -d chhoto-url
|
||||
docker logs chhoto-url -f
|
||||
|
||||
docker-dev: test build-dev
|
||||
|
||||
@@ -23,8 +23,9 @@ services:
|
||||
# Change if you want to mount the database somewhere else.
|
||||
# In this case, you can get rid of the db volume below
|
||||
# and instead do a mount manually by specifying the location.
|
||||
# Make sure that you create an empty file with the correct name
|
||||
# before starting the container if you do make any changes.
|
||||
# Make sure that you mount a directory instead of a bare file
|
||||
# since that might have a (low, but non-zero) possibility of
|
||||
# corrupting your db since we use WAL journaling mode
|
||||
# (In fact, I'd suggest that you do that so that you can keep
|
||||
# a copy of your database.)
|
||||
- db_url=/db/urls.sqlite
|
||||
|
||||
Reference in New Issue
Block a user