Change Dockerfiles and docker-compose file
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

The reason for this change is to reduce the image size for the different containers
This commit is contained in:
cami 2021-09-01 02:20:53 +02:00
parent e32ab08b7d
commit 6a3d510cad
7 changed files with 74 additions and 29 deletions

1
backend/.dockerignore Normal file
View file

@ -0,0 +1 @@
venv

View file

@ -1,11 +1,19 @@
FROM python
FROM python:slim as base
FROM base as builder
RUN mkdir /install
WORKDIR /install
COPY requirements.txt /requirements.txt
RUN pip install --prefix=/install -r /requirements.txt
FROM base
COPY --from=builder /install /usr/local
COPY /src /app
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY /src .
CMD [ "flask", "run" ]

View file

@ -1,15 +1,19 @@
FROM python
WORKDIR /app
FROM python:slim as base
RUN apt-get -y update && apt-get -y upgrade
COPY requirements.txt .
FROM base as builder
RUN mkdir /install
WORKDIR /install
RUN apt-get -y install sqlite3
COPY requirements.txt /requirements.txt
RUN pip install --prefix=/install -r /requirements.txt
RUN pip install -r requirements.txt
FROM base
COPY /src .
COPY --from=builder /install /usr/local
CMD [ "python", "app.py" ]
COPY /src /app
WORKDIR /app
CMD [ "flask", "run" ]