forked from SaiJeevanPuchakayala/StealthSolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (33 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.10.13-slim-bullseye
WORKDIR /app
RUN apt update && apt install -y python3-opencv \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
&& printf ", TARGETARCH=${TARGETARCH}" \
&& printf ", TARGETVARIANT=${TARGETVARIANT} \n" \
&& printf "With uname -s : " && uname -s \
&& printf "and uname -m : " && uname -m
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
pip install --no-cache-dir keras; \
pip install --no-cache-dir tensorflow; \
else \
pip install --no-cache-dir keras==2.8.0; \
pip install --no-cache-dir --ignore-installed --upgrade https://tf.novaal.de/core2/tensorflow-2.8.0-cp310-cp310-linux_x86_64.whl; \
fi
COPY app.py .
COPY background2.jpg .
COPY helpers.py .
COPY self_captcha_model2.hdf5 .
COPY self_model_labels2.dat .
EXPOSE 8000
ENV FLASK_APP=app.py
ENV FLASK_ENV="docker"
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]