-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:histify/geophotoradar
- Loading branch information
Showing
10 changed files
with
104 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
from csv import DictReader | ||
from typing import List | ||
|
||
from app.record import Record | ||
from typing import List | ||
import csv | ||
|
||
|
||
class Importer: | ||
def read_csv_to_records(self, csv_reader: DictReader) -> List[Record]: | ||
records = [] | ||
for row in csv_reader: | ||
try: | ||
lat_str, lon_str = row['coordinates'].split(',') | ||
except ValueError as e: | ||
lat_str, lon_str = row["coordinates"].split(",") | ||
except ValueError: | ||
# print(str(e)) | ||
continue | ||
lat = float(lat_str.strip()) | ||
lon = float(lon_str.strip()) | ||
# Create a Record instance from each row | ||
record = Record( | ||
id=row['id'], | ||
title=row['title'], | ||
image_url=row['image_url'], | ||
id=row["id"], | ||
title=row["title"], | ||
image_url=row["image_url"], | ||
lat=lat, | ||
lon=lon, | ||
iiif_url=row['iiif_url'], | ||
source_system_url=row['source_system_url'] | ||
iiif_url=row["iiif_url"], | ||
source_system_url=row["source_system_url"], | ||
) | ||
records.append(record) | ||
return records | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
FROM node:22-alpine3.20 | ||
|
||
FROM node:22-alpine3.20 AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
RUN corepack enable | ||
|
||
WORKDIR /app/player | ||
|
||
WORKDIR /app | ||
COPY pnpm-lock.yaml package.json ./ | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
|
||
FROM base AS dev | ||
EXPOSE 3000 | ||
|
||
CMD [ "pnpm", "run", "dev", "--host", "0.0.0.0" ] | ||
|
||
|
||
FROM base AS builder | ||
RUN pnpm generate | ||
|
||
|
||
FROM nginx:1.27.1-alpine AS prod | ||
COPY ./docker/frontend.nginx.conf /etc/nginx/templates/default.conf.template | ||
COPY --from=builder /app/dist /usr/share/nginx/html | ||
ENV API_HOST=api | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,5 +41,6 @@ | |
"@vueuse/core": "^11.0.3", | ||
"leaflet": "^1.9.4", | ||
"lodash-es": "^4.17.21" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
upstream api { | ||
server ${API_HOST}:8000; | ||
} | ||
|
||
upstream frontend { | ||
server ${FRONTEND_HOST}:3000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name localhost; | ||
charset utf-8; | ||
|
||
location ~* ^/(api)($|/) { | ||
proxy_pass http://api; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
} | ||
|
||
location / { | ||
proxy_pass http://frontend; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
} | ||
} |