-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (34 loc) · 1.34 KB
/
Dockerfile
File metadata and controls
47 lines (34 loc) · 1.34 KB
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
# Use Ubuntu as the base image
FROM ubuntu:22.04
# Set the working directory in the container
RUN apt-get update && apt-get install -y \
python3.11 \
python3-pip
# Install required dependencies and tools
RUN apt-get update && apt-get install -y \
curl \
gnupg2 \
unixodbc \
unixodbc-dev \
software-properties-common \
apt-transport-https \
ca-certificates
# Add Microsoft's package repository for the ODBC driver
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list -o /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update
# Install the ODBC Driver 17 for SQL Server
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
# Clean up to reduce the image size
RUN rm -rf /var/lib/apt/lists/*
# Copy the requirements file and install dependencies
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code to the container
COPY . /app
WORKDIR /app
# Expose the port that your app runs on
EXPOSE 8000
# Command to run Gunicorn with Gevent worker class for async handling
#CMD ["gunicorn", "--bind=0.0.0.0", "-k", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", "-w=1", "--chdir", "src/", "main:app"]
CMD ["python3","main.py"]