External storage was added
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
storage-dev/*
|
||||||
|
storage-prod/*
|
||||||
@@ -5,7 +5,6 @@ RUN pip install websockets
|
|||||||
WORKDIR /beerlog-srv
|
WORKDIR /beerlog-srv
|
||||||
COPY beerlog-srv.py .
|
COPY beerlog-srv.py .
|
||||||
COPY storage.py .
|
COPY storage.py .
|
||||||
COPY users.obj .
|
|
||||||
|
|
||||||
ARG BEERLOG_PORT
|
ARG BEERLOG_PORT
|
||||||
ENV BEERLOG_PORT $BEERLOG_PORT
|
ENV BEERLOG_PORT $BEERLOG_PORT
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ services:
|
|||||||
args:
|
args:
|
||||||
BEERLOG_PORT: 8000
|
BEERLOG_PORT: 8000
|
||||||
network: host
|
network: host
|
||||||
|
volumes:
|
||||||
|
- ./storage-dev:/storage/
|
||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
beerlog-srv-prod:
|
beerlog-srv-prod:
|
||||||
@@ -19,6 +21,8 @@ services:
|
|||||||
args:
|
args:
|
||||||
BEERLOG_PORT: 8080
|
BEERLOG_PORT: 8080
|
||||||
network: host
|
network: host
|
||||||
|
volumes:
|
||||||
|
- ./storage-prod:/storage/
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Storage():
|
|||||||
objects = {}
|
objects = {}
|
||||||
|
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.name = f"./{name}.obj"
|
self.name = f"/storage/{name}.obj"
|
||||||
self._load()
|
self._load()
|
||||||
|
|
||||||
def _load(self):
|
def _load(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user