forked from maya-a-iuga/Web-App-DevOps-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 1.22 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (28 loc) · 1.22 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
# Use an official Python runtime as a parent image
# Using a specific image for M1/M2 chip Mac users
ARG ARCH
FROM python:3.9
FROM --platform=linux/amd64 public.ecr.aws/docker/library/python:3.9.10-slim-buster
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install system dependencies and ODBC driver
RUN apt-get update && apt-get install -y \
unixodbc unixodbc-dev odbcinst odbcinst1debian2 libpq-dev gcc && \
apt-get install -y gnupg && \
apt-get install -y wget && \
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
wget -qO- https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
# apt-get purge -y --auto-remove wget && \
apt-get clean
# Install pip and setuptools
RUN pip install --upgrade pip setuptools
# Install Python packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Expose port 5000 (change to your desired port)
EXPOSE 5000
# Run app.py when the container launches
CMD ["python", "app.py"]