forked from SACGF/cdot_rest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 930 Bytes
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 930 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
29
30
31
32
33
34
35
36
FROM python:3.11-slim AS python-base
# git CLI
RUN apt-get update && apt-get install -y git gcc libpq-dev && rm -rf /var/lib/apt/lists/*
## Prepare virtual env
ENV VIRTUAL_ENV="/venv"
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python3 -m venv $VIRTUAL_ENV
## Python path
ENV PYTHONPATH="$PYTHONPATH:/code/cdot_rest"
WORKDIR /code
## Prepare dependencies
COPY requirements.txt .
# python deps
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install gunicorn
RUN python3 -m pip install psycopg2
# application deps
RUN python3 -m pip install -r requirements.txt
## Download static CDOT transcript files
WORKDIR /data
COPY bin/download_latest_cdot_transcript_files.py .
RUN python3 download_latest_cdot_transcript_files.py
RUN rm download_latest_cdot_transcript_files.py
## Prepare rest server
WORKDIR /code
COPY manage.py .
COPY bin/load_cdot_transcript_files.py .
COPY cdot_json/ cdot_json/
COPY cdot_rest/ cdot_rest/