add: docker tmpfs vol

v0.1
rrr-marble 4 years ago
parent e25c0d0382
commit 6d21c5083d

@ -6,10 +6,18 @@ services:
build:
context: ../src/
dockerfile: Dockerfile
volumes:
- tmp_vol:/tmp
postgres:
image: "postgres:13-bullseye"
environment:
POSTGRES_USER: "geodata"
POSTGRES_DB: "geodata"
POSTGRES_PASSWORD: "QAKvBKvLe4bS9U"
POSTGRES_PASSWORD: "QAKvBKvLe4bS9U"
volumes:
tmp_vol:
driver_opts:
type: tmpfs
device: tmpfs

@ -34,7 +34,7 @@ def parse(file: UploadFile = File(...)):
suffix = Path(file.filename).suffix
try:
# TODO: decide if we use subdir in /tmp here, then create it [5]
with NamedTemporaryFile(delete=False, suffix=suffix, dir="/tmp/notgeo") as tmp:
with NamedTemporaryFile(delete=False, suffix=suffix, dir="/tmp") as tmp:
copyfileobj(file.file, tmp)
spreadsheet_file = Path(tmp.name)

Loading…
Cancel
Save