add docker config
Andronaco Marco marco.andronaco@olivetti.com
Thu, 17 Aug 2023 19:07:46 +0200
3 files changed,
38 insertions(+),
3 deletions(-)
A
Dockerfile
@@ -0,0 +1,12 @@
+FROM tecktron/python-waitress:slim + +RUN pip install --upgrade pip + +WORKDIR /app +COPY ./requirements.txt . +RUN pip install -r requirements.txt + +COPY ./migrations ./migrations +COPY ./myprecious ./myprecious + +ENV APP_MODULE=myprecious:app
M
README.md
→
README.md
@@ -2,15 +2,25 @@ # myprecious
## Configuration ``` -poetry install --with prod +cp .env.example .env +nano .env ``` -## Usage +### Docker ``` -poetry run waitress-serve --port 1111 myprecious:app +docker-compose up -d ``` ### Debug ``` +poetry install poetry run flask --app myprecious run --port 1111 --debug ``` + + +## Production +``` +poetry install --with prod +poetry run waitress-serve --port 1111 myprecious:app +``` +
A
docker-compose.yaml
@@ -0,0 +1,13 @@
+services: + app: + build: . + image: myprecious:latest + container_name: myprecious + ports: + - 127.0.0.1:1111:80 + volumes: + - /etc/localtime:/etc/localtime:ro + - data:/app/data + - ${PWD}/.env:/app/.env +volumes: + data: