Запихнул в docker-compose

This commit is contained in:
Lulzette 2021-10-18 15:16:02 +00:00
parent 6cd33f25be
commit 32a2678170
5 changed files with 25 additions and 2 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM python:latest
ADD . /app
WORKDIR /app
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
EXPOSE 8080
CMD python3 main.py

View File

@ -1,5 +1,5 @@
[DB] [DB]
host = localhost host = db
port = 27017 port = 27017
name = pycms name = pycms

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3'
services:
server:
build: .
ports:
- 8080:8080
volumes:
- ./config.ini:/app/config.ini
depends_on:
- db
db:
image: mongo

View File

@ -143,7 +143,9 @@ def index():
if __name__ == '__main__': if __name__ == '__main__':
print("Init")
cfg = Config() cfg = Config()
print("Configured")
back = Back() back = Back()
posts = cfg.posts posts = cfg.posts
run(host='0.0.0.0', port=8081, reloader=True, debug=True) run(host='0.0.0.0', port=8080, reloader=True, debug=True)