move gejson and db to storage directory #5

Merged
ammaratef45 merged 1 commits from storage into main 2026-05-23 04:47:21 +00:00
4 changed files with 6 additions and 106 deletions

View File

@ -7,8 +7,8 @@ RUN cargo build --release
# Run stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libssl3 ca-certificates libsqlite3-0 && apt-get clean
COPY --from=builder /usr/src/app/Neighborhood_Map_Atlas_Neighborhoods.geojson /
COPY --from=builder /usr/src/app/storage/Neighborhood_Map_Atlas_Neighborhoods.geojson /storage/
COPY --from=builder /usr/src/app/target/release/mapbattle /usr/local/bin/mapbattle
COPY --from=builder /usr/src/app/mapbattle.db /
COPY --from=builder /usr/src/app/storage/mapbattle.db /storage/
EXPOSE 8080
CMD ["mapbattle"]

File diff suppressed because one or more lines are too long

View File

@ -21,8 +21,9 @@ impl GeoUtils {
}
fn load_feature_collection() -> FeatureCollection {
let txt: String = fs::read_to_string("Neighborhood_Map_Atlas_Neighborhoods.geojson")
.expect("file should be present");
let txt: String =
fs::read_to_string("./storage/Neighborhood_Map_Atlas_Neighborhoods.geojson")
.expect("file should be present");
let geojson_str = txt;
let geojson: GeoJson = geojson_str.parse::<GeoJson>().unwrap();
FeatureCollection::try_from(geojson).unwrap()

View File

@ -193,7 +193,7 @@ async fn main() -> std::io::Result<()> {
}
env_logger::init();
let manager = SqliteConnectionManager::file("mapbattle.db");
let manager = SqliteConnectionManager::file("./storage/mapbattle.db");
let pool = Pool::new(manager).unwrap();
let games = db::games(&pool)
.await