External storage was added

This commit is contained in:
2023-04-18 16:47:21 +02:00
parent 2e615a2f69
commit e9ed4206db
4 changed files with 7 additions and 2 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
storage-dev/*
storage-prod/*

View File

@@ -5,7 +5,6 @@ RUN pip install websockets
WORKDIR /beerlog-srv
COPY beerlog-srv.py .
COPY storage.py .
COPY users.obj .
ARG BEERLOG_PORT
ENV BEERLOG_PORT $BEERLOG_PORT

View File

@@ -9,6 +9,8 @@ services:
args:
BEERLOG_PORT: 8000
network: host
volumes:
- ./storage-dev:/storage/
ports:
- 8000:8000
beerlog-srv-prod:
@@ -19,6 +21,8 @@ services:
args:
BEERLOG_PORT: 8080
network: host
volumes:
- ./storage-prod:/storage/
ports:
- 8080:8080

View File

@@ -7,7 +7,7 @@ class Storage():
objects = {}
def __init__(self, name):
self.name = f"./{name}.obj"
self.name = f"/storage/{name}.obj"
self._load()
def _load(self):