Merge remote-tracking branch 'origin/main' into territories

This commit is contained in:
2026-05-23 22:10:29 -07:00
5 changed files with 10 additions and 8 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"]

View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash
cd $(dirname "$0")
sqlite3 ../mapbattle.db < db.sql
sqlite3 -csv ../mapbattle.db ".import init_games.csv games"
sqlite3 -csv ../mapbattle.db ".import init_teams.csv teams"
db_file='../storage/mapbattle.db'
sqlite3 "$dbfile" < db.sql
sqlite3 -csv "$dbfile" ".import init_games.csv games"
sqlite3 -csv "$dbfile" ".import init_teams.csv teams"

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

@ -209,7 +209,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