-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathDockerfile
41 lines (29 loc) · 875 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Production Dockerfile
FROM python:3.11
ENV DEBIAN_FRONTEND=noninteractive
RUN pip install aider-chat
#COPY .nvmrc .
# $(cat .nvmrc)
RUN curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
RUN chmod +x ./nodesource_setup.sh && ./nodesource_setup.sh
RUN apt install -y nodejs
ENV user=sophia
ENV homedir=/home/sophia/
RUN useradd --create-home -g users sophia
WORKDIR $homedir
RUN mkdir ".husky"
COPY .husky/install.mjs .husky/install.mjs
COPY package*.json ./
RUN npm ci
COPY . .
# Download the tiktokenizer model, which is written to node_modules/@microsoft/tiktokenizer/model,
# as the root user, as the sophia user can't write to node_modules
RUN npm run initTiktokenizer
USER $user
RUN mkdir .sophia
# Generate the function schemas
RUN npm run functionSchemas
ENV NODE_ENV=production
ENV PORT=8080
EXPOSE 8080
CMD [ "npm", "run", "start" ]