-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_Backend
46 lines (35 loc) · 1.37 KB
/
Dockerfile_Backend
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
# Use a Python 3.10 image based on Debian slim as the base
FROM python:3.10-slim
LABEL authors="iejohnson"
ARG APP_ENV
ENV APP_ENV=${APP_ENV}
# Update the package lists and install dependencies required for psycopg2 and other operations
RUN apt-get update && apt-get install -y \
gcc \
python3-dev \
libpq-dev \
inetutils-ping \
# Clean up the apt cache to reduce image size
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory inside the container to /app
WORKDIR /app
# Copy the Python requirements file into the container
COPY job_monitoring_app/backend/requirements.txt .
# Install the Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy the project code into the container
COPY job_monitoring_app/backend/root.py ./root.py
COPY job_monitoring_app/backend/config ./config
COPY job_monitoring_app/backend/alembic ./alembic
COPY job_monitoring_app/backend/alembic.ini ./alembic.ini
COPY job_monitoring_app/backend/app ./app
COPY job_monitoring_app/backend/tasks.py ./tasks.py
COPY job_monitoring_app/backend/seed.py ./seed.py
#COPY job_monitoring_app/trackerapi /app/trackerapi
#RUN APP_ENV=development alembic upgrade head
EXPOSE 8000
# Set the default command for the container
#CMD ["uvicorn", "app.main:app"]
#ENTRYPOINT ["uvicorn", "app.main:app"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0"]