-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
27 lines (18 loc) · 919 Bytes
/
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
FROM node:current as builder
COPY frontend /frontend
WORKDIR /frontend
RUN npm install; npm run build
FROM python:3.10-slim
# Copy only requirements to cache them in docker layer
WORKDIR /code
COPY requirements.txt /code/
# Project initialization:
RUN pip install -r requirements.txt
# Install pre-trained models here
# Example:
RUN python -c 'from sentence_transformers import SentenceTransformer; SentenceTransformer("all-MiniLM-L6-v2");'
RUN python -c 'from transformers import RobertaTokenizer, RobertaModel, RobertaConfig; RobertaTokenizer.from_pretrained("microsoft/unixcoder-base") ; RobertaModel.from_pretrained("microsoft/unixcoder-base") ; RobertaConfig.from_pretrained("microsoft/unixcoder-base");'
# Creating folders, and files for a project:
COPY . /code
COPY --from=builder /frontend/dist /code/frontend/dist
CMD uvicorn code_search.service:app --host 0.0.0.0 --port 8000 --workers ${WORKERS:-1}