-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.django
56 lines (39 loc) · 1.53 KB
/
Dockerfile.django
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
48
49
50
51
52
53
54
FROM python:3.10-slim
# Install necessary dependencies including PostgreSQL development libraries
RUN apt-get update && apt-get install -y \
git \
python3.10 \
python3-pip \
python3-dev \
python3-venv \
build-essential \
libpq-dev # PostgreSQL development libraries required for psycopg2
# Install netcat for database checking
RUN apt-get update && apt-get install -y netcat-openbsd
# Set Python 3.10 as the default
# RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
# Create and activate a virtual environment
RUN python3 -m venv /env
ENV PATH="/env/bin:$PATH"
# Upgrade pip inside the virtual environment
RUN pip install --upgrade pip
# Clone the repository
# RUN git clone https://github.com/VIP-LES/EosGround.git /EosGround
COPY . /EosGround
# RUN python3 -m EosGround.database.db_setup
# RUN python3 -m EosGround.database.pipeline
# Set working directory
WORKDIR /EosGround
# Install dependencies from requirements.txt inside the virtual environment
RUN pip install -r requirements.txt
# Set the working directory to the 'postgresDB' folder and run the Django server
WORKDIR /EosGround/postgresDB
# TODO: FIRST ADD THE SQL FILE INTO pgAdmin then run the following commands:
# RUN python3 manage.py makemigrations
#RUN python3 manage.py migrate
# # RUN python3 manage.py migrate
# Copy and set permissions for entrypoint script
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Change the CMD to use the entrypoint script
CMD ["/docker-entrypoint.sh"]