Hey all im currently building an web application based on flask/mariadb/nginx and so on. Im currently wondering if you guys know of a way to use the python packages i have installed on my local dev machine.
Currently all is done via the regular requirements.txt in my Dockerfile.
Here is my Compose file:
version: '3'
services:
backendserver:
build:
context: ./backendServer
#dockerfile: ./backendServer/Dockerfile
ports:
- "5000:5000"
networks:
- db_network
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: DB_PW
MYSQL_USER: DB_USER
MYSQL_DATABASE: DB_NAME
volumes:
- ./shared-files:/var/lib/mysql
networks:
- db_network
ports:
- "3306:3306"
pabs_ss:
restart: always
env_file: .env
build: .
volumes:
- ./shared-files:/shared-files
ports:
- "5005:5005"
networks:
- db_network
- web_network
nginx:
restart: always
image: "nginx:latest"
ports:
- "85:85"
volumes:
- ./nginx:/etc/nginx/conf.d
networks:
- web_network
depends_on:
- pabs_ss
networks:
db_network:
driver: bridge
web_network:
driver: bridge
Here is my Dockerfile:
FROM python:3.6
ENV FLASK_APP run.py
COPY run.py gunicorn-cfg.py requirements.txt config.py .env ./
COPY app app
#COPY shared-files/db.sqlite3 /
RUN pip install -r requirements.txt
EXPOSE 5005 8080
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"]
As you can see im currently using the "normal" way of doing, though im growing quite tired of basically downloading everything everytime.
So any idea of how i can use the python packages from my local machine in the container?
Thanks and advance and so long :)