Starting with docker implementation for python. Does not work at the moment #3

Merged
cami merged 3 commits from feature/flaskdocker into main 2021-05-11 00:05:28 +00:00
5 changed files with 50 additions and 16 deletions
Showing only changes of commit 6ad07d2541 - Show all commits

View file

@ -1,2 +1,2 @@
FLASK_APP=src/api.py
FLASK_APP=src/app.py
FLASK_ENV=development

19
backend/Dockerfile Normal file
View file

@ -0,0 +1,19 @@
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.9
EXPOSE 5000
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Install pip requirements
ADD requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
ADD . /app
CMD ["flask", "run"]

30
docker-compose.yml Normal file
View file

@ -0,0 +1,30 @@
version: '3.7'
services:
frontend-dev:
container_name: hello_world_client
build:
context: ./frontend
dockerfile: Dockerfile
tty: true
volumes:
- './frontend/.:/app:z'
- '/app/node_modules'
ports:
- 3000:3000
environment:
- CHOKIDAR_USEPOLLING=true
backend-dev:
container_name: backend_bt
build:
context: ./backend
dockerfile: Dockerfile
tty: true
volumes:
- ./backend:/usr/src/app/
ports:
- 5000:5000
environment:
PORT: 5000
FLASK_DEBUG: 1

View file

@ -1,15 +0,0 @@
version: '3.7'
services:
hello-dev:
container_name: hello_world_client
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/app:z'
- '/app/node_modules'
ports:
- 3000:3000
environment:
- CHOKIDAR_USEPOLLING=true