tebakaja commited on
Commit
2fb7e91
·
1 Parent(s): 5c5d998

migrate: GCP to Hugging Face

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -8,20 +8,24 @@ LABEL Infra_engineer="Al-Fariqy Raihan Azhwar"
8
  ENV PYTHONDONTWRITEBYTECODE 1
9
  ENV PYTHONUNBUFFERED 1
10
 
 
 
 
 
11
  WORKDIR /etc/docpet_backend_service
12
 
13
  RUN python3 -m pip install --upgrade pip
14
 
15
- COPY requirements/linux.requirements.txt \
16
  /etc/docpet_backend_service/
17
 
18
- RUN pip3 install -r linux.requirements.txt
19
 
20
- COPY . /etc/docpet_backend_service/
21
 
22
  RUN wget -O /etc/docpet_backend_service/ml_models/model.h5 \
23
  https://github.com/belajarqywok/mbadhog/raw/main/model.h5
24
 
25
  EXPOSE 7860
26
 
27
- CMD [ "/bin/bash", "-c", "alembic upgrade head && uvicorn app:app --host 0.0.0.0 --port 7860 --workers 30" ]
 
8
  ENV PYTHONDONTWRITEBYTECODE 1
9
  ENV PYTHONUNBUFFERED 1
10
 
11
+ RUN useradd -m -u 1000 user
12
+ USER user
13
+ ENV PATH="/home/user/.local/bin:$PATH"
14
+
15
  WORKDIR /etc/docpet_backend_service
16
 
17
  RUN python3 -m pip install --upgrade pip
18
 
19
+ COPY --chown=user requirements/linux.requirements.txt \
20
  /etc/docpet_backend_service/
21
 
22
+ RUN pip install --no-cache-dir --upgrade -r linux.requirements.txt
23
 
24
+ COPY --chown=user . /etc/docpet_backend_service/
25
 
26
  RUN wget -O /etc/docpet_backend_service/ml_models/model.h5 \
27
  https://github.com/belajarqywok/mbadhog/raw/main/model.h5
28
 
29
  EXPOSE 7860
30
 
31
+ CMD [ "alembic upgrade head && uvicorn app:app --host 0.0.0.0 --port 7860 --workers 30" ]