Skip to content

Commit 563ffa8

Browse files
committed
inital docker image
1 parent f36a0d0 commit 563ffa8

5 files changed

Lines changed: 28 additions & 2 deletions

File tree

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3-slim AS builder
2+
3+
COPY requirements.txt .
4+
RUN pip install --user -r requirements.txt
5+
6+
FROM python:3-slim
7+
RUN mkdir /app
8+
WORKDIR /app
9+
COPY --from=builder /root/.local /root/.local
10+
COPY ddb.py pyxie.py constfig.py config.yaml run.sh ./
11+
ENV PATH=/root/.local/bin:$PATH
12+
EXPOSE 8000
13+
# CMD ["python", "pyxie.py"]
14+
CMD ["/app/run.sh"]

constfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class _C(object):
1010
def __init__(self):
1111
# Default values for user configurable items
12-
self.LISTEN_IP = "0.0.0.0"
12+
self.LISTEN_IP = "127.0.0.1"
1313
self.LISTEN_PORT = 5000
1414
self.API_KEYS = []
1515
self.LOG_LEVEL = "WARNING"

pyxie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def root():
5757

5858

5959
def main():
60-
pyxie.run()
60+
pyxie.run(host=C.LISTEN_IP, port=C.LISTEN_PORT)
6161

6262

6363
if __name__ == "__main__":

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pyyaml
22
flask
33
ua-parser
4+
gunicorn

run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
if [ -z "$LISTEN_IP" ]; then
4+
export LISTEN_IP="0.0.0.0"
5+
fi
6+
7+
if [ -z "$LISTEN_PORT" ]; then
8+
export LISTEN_PORT=8000
9+
fi
10+
11+
gunicorn --bind $LISTEN_IP:$LISTEN_PORT pyxie:pyxie

0 commit comments

Comments
 (0)