example compose.yaml, includestr styles, ignore default bind mount
This commit is contained in:
@@ -28,3 +28,4 @@ README.md
|
|||||||
readme
|
readme
|
||||||
**/*.db*
|
**/*.db*
|
||||||
**/*.db3*
|
**/*.db3*
|
||||||
|
/mnemodata
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
/target
|
/target
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/database
|
/database
|
||||||
|
/mnemodata
|
||||||
*.db
|
*.db
|
||||||
*.db-shm
|
*.db-shm
|
||||||
*.db-wal
|
*.db-wal
|
||||||
|
|||||||
20
compose.yaml
Normal file
20
compose.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
services:
|
||||||
|
mnemosyne:
|
||||||
|
container_name: mnemosyne
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
target: final
|
||||||
|
ports:
|
||||||
|
- 39321:39321
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
# Mnemosyne would greatly enjoy not having an ephemeral database.
|
||||||
|
# If you're okay with storing it side by side with the compose file,
|
||||||
|
# this is one way to do it. Another is to use a docker volume.
|
||||||
|
- ./mnemodata:/app/data
|
||||||
|
environment:
|
||||||
|
# DATABASE_URL is crucial for Mnemosyne to work; it will fail without it.
|
||||||
|
# point it at where you'd like your database to be.
|
||||||
|
- DATABASE_URL=/app/data/db.db
|
||||||
|
# Mnemosyne uses port 39321 for HTTP by default;
|
||||||
|
# - PORT=39321
|
||||||
@@ -1,16 +1,22 @@
|
|||||||
use axum::{
|
use axum::{
|
||||||
Router,
|
Router,
|
||||||
|
http::header,
|
||||||
response::{IntoResponse, Redirect, Response},
|
response::{IntoResponse, Redirect, Response},
|
||||||
|
routing::get,
|
||||||
};
|
};
|
||||||
use tower_http::services::ServeFile;
|
|
||||||
|
|
||||||
mod components;
|
mod components;
|
||||||
mod icons;
|
mod icons;
|
||||||
mod pages;
|
mod pages;
|
||||||
|
|
||||||
|
pub const STYLES_CSS: &str = include_str!("./styles.css");
|
||||||
|
|
||||||
pub fn web_router() -> Router {
|
pub fn web_router() -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
.route_service("/styles.css", ServeFile::new("src/web/styles.css"))
|
.route(
|
||||||
|
"/styles.css",
|
||||||
|
get(|| async { ([(header::CONTENT_TYPE, "text/css")], STYLES_CSS) }),
|
||||||
|
)
|
||||||
.merge(pages::pages())
|
.merge(pages::pages())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user