From 0b0c005416e6a6e06d7e741367c33f2ae3a009d6 Mon Sep 17 00:00:00 2001 From: Sarah G Date: Mon, 21 Aug 2023 11:27:47 +0200 Subject: [PATCH] Delete Dockerfile-dso --- backend/Dockerfile-dso | 49 ----------------------------------------- frontend/Dockerfile-dso | 39 -------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 backend/Dockerfile-dso delete mode 100644 frontend/Dockerfile-dso diff --git a/backend/Dockerfile-dso b/backend/Dockerfile-dso deleted file mode 100644 index b3dc618f..00000000 --- a/backend/Dockerfile-dso +++ /dev/null @@ -1,49 +0,0 @@ -FROM python:3.9-slim-buster as base -WORKDIR /app - -# certificates config -ARG CACERT_LOCATION -COPY ./cert/. /etc/ssl/certs/ - -# librairies necessary for image processing -RUN apt update && apt install -y \ - libgl1-mesa-glx \ - libglib2.0-0 \ - curl \ - gcc \ - && rm -rf /var/lib/apt/lists/* - -# install python libraries -COPY requirements.txt ./ -ENV PIP_CERT=$CACERT_LOCATION -RUN pip install --upgrade pip \ - && pip --default-timeout=300 install --no-cache-dir -f \ - https://download.pytorch.org/whl/cpu/torch_stable.html -r requirements.txt \ - && rm -r /root/.cache - -# launch website -ARG VERSION -ARG MODEL="EffB4_2022-03-02_08" -ENV SSL_CERT_FILE=$CACERT_LOCATION -RUN curl -o model.pth https://storage.gra.cloud.ovh.net/v1/AUTH_df731a99a3264215b973b3dee70a57af/basegun-public/models/${MODEL}/${MODEL}.pth -COPY src/ src/ -RUN mkdir -p src/weights \ - && mv model.pth src/weights/model.pth \ - && echo '{"app": "'${VERSION}'", "model": "'${MODEL}'"}' > versions.json - -FROM base as dev -CMD ["uvicorn", "src.main:app", "--reload", "--host", "0.0.0.0", "--port", "5000"] - -FROM base as test -RUN pip install requests && rm -r /root/.cache -COPY tests/ tests/ -CMD ["uvicorn", "src.main:app", "--reload", "--host", "0.0.0.0", "--port", "5000"] - -FROM base as prod -USER root -RUN ls -RUN grep -rlw http /etc |while read i ;do sed -ri 's#\b80\b#8080#' ${i} ; sed -ri 's#\b443\b#6443#' ${i} ;done -RUN find / -xdev -exec chmod -f -c g=u {} \; -exec chown -f -c 1001:root {} \; >/dev/null 2>&1 -RUN grep -w 1001 /etc/passwd ||echo "rootless:x:1001:0:root:/root:/bin/bash" >>/etc/passwd -USER 1001 -CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "5000"] diff --git a/frontend/Dockerfile-dso b/frontend/Dockerfile-dso deleted file mode 100644 index d4af73a5..00000000 --- a/frontend/Dockerfile-dso +++ /dev/null @@ -1,39 +0,0 @@ -FROM node:18-bullseye-slim as base - -WORKDIR /app - -# certificates config -ARG NODE_EXTRA_CA_CERTS -COPY ./cert/. /etc/ssl/certs/ - -# downgrade npm version to avoid chokidar error -RUN npm install -g npm@8 - -COPY ./package.json ./package-lock.json ./ -RUN npm ci - -COPY src ./src -COPY public ./public -COPY vite.config.js index.html ./ - -FROM base as dev - -CMD ["npm", "run", "dev"] - -FROM base as build - -# RUN npm ci --production -RUN npm run build - -FROM nginx:1.21.4-alpine as prod - -COPY nginx.conf /etc/nginx/nginx.conf - -COPY --from=build /app/dist /usr/share/nginx/html/ - -USER root -RUN ls -RUN grep -rlw http /etc |while read i ;do sed -ri 's#\b80\b#8080#' ${i} ; sed -ri 's#\b443\b#6443#' ${i} ;done -RUN find / -xdev -exec chmod -f -c g=u {} \; -exec chown -f -c 1001:root {} \; >/dev/null 2>&1 -RUN grep -w 1001 /etc/passwd ||echo "rootless:x:1001:0:root:/root:/bin/bash" >>/etc/passwd -USER 1001