Change Dockerfiles and docker-compose file
The reason for this change is to reduce the image size for the different containers
This commit is contained in:
parent
e32ab08b7d
commit
6a3d510cad
7 changed files with 74 additions and 29 deletions
1
backend/.dockerignore
Normal file
1
backend/.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
venv
|
|
@ -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" ]
|
||||
|
|
|
@ -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" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue