-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (21 loc) · 890 Bytes
/
Dockerfile
File metadata and controls
37 lines (21 loc) · 890 Bytes
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
FROM python:latest
# Upgrade pip and install necessary Python packages
RUN pip3 install --upgrade pip
RUN pip3 install uvicorn fastapi[all] motor python-jose[cryptography]
# Passing sensitive data this way as well as tracking it in version control is a really bad idea.
# Use docker secrets or a similar solution instead.
ENV MONGODB_HOST="mongodb_node"
ENV MONGODB_HOST_PORT=27017
ENV DBNAME="CaseStudy3"
ENV SECRET_KEY="xj3zTIYDtc"
ENV LOGS_PATH="/var/log/webserver/requests_activity.log"
# Set the working directory to /opt/webserver
WORKDIR /opt/webserver
# Copy the application files into the container
COPY . .
# Create a volume for storing log files
VOLUME ["/var/log/webserver/"]
# Expose the application's port
EXPOSE 8891
# Define the entry point for running the application
ENTRYPOINT ["uvicorn", "server:app", "--reload", "--host", "0.0.0.0", "--port", "8891"]