-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (47 loc) · 1.44 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM nikolaik/python-nodejs:python3.10-nodejs19
USER pn
WORKDIR /home/pn/app
# ARGs
ARG BASE_URL="/"
# ENVs
ENV MONGO_CONNECTION_STRING=""
ENV REDIS_HOST=""
ENV REDIS_PORT="6379"
ENV REDIS_PASSWORD=""
# SETUP THE FRONTEND
WORKDIR /home/pn/app/frontend
COPY frontend/package.json ./
COPY frontend/vite.config.js ./
# COPY frontend/public ./public
COPY frontend/src ./src
COPY frontend/index.html ./
RUN npm install
RUN npm run build -- --base ${BASE_URL}
# SETUP THE BACKEND
WORKDIR /home/pn/app/backend
COPY backend/requirements.txt ./
COPY backend/main.py ./
COPY backend/UserHandler.py ./
COPY backend/TissCalHandler.py ./
COPY backend/MyCalendar.py ./
COPY backend/Lva.py ./
COPY backend/MyMongoClient.py ./
COPY backend/MyHTTPException.py ./
RUN mkdir models
COPY backend/models/ErrorResponse.py ./models
COPY backend/models/ResponseBase.py ./models
COPY backend/models/TissCalModels.py ./models
COPY backend/models/UserModels.py ./models
RUN mkdir resources
COPY backend/resources ./resources
RUN pip install --no-cache-dir -r requirements.txt
RUN touch .env
RUN echo "BASE_URL=\"${BASE_URL}\"" >> .env
RUN echo "MONGO_CONNECTION_STRING=\"${MONGO_CONNECTION_STRING}\"" >> .env
RUN echo "REDIS_HOST=\"${REDIS_HOST}\"" >> .env
RUN echo "REDIS_PORT=\"${REDIS_PORT}\"" >> .env
RUN echo "REDIS_PASSWORD=\"${REDIS_PASSWORD}\"" >> .env
# EXPOSE PORT 80
EXPOSE 80
# RUN THE APP
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]