-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (24 loc) · 897 Bytes
/
Dockerfile
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
# Fetch Python 3.12
FROM python:3.12
# The enviroment variable ensures that the python output is set straight to the terminal with out buffering it first
ENV PYTHONUNBUFFERED 1
# create root directory for our project in the container
RUN mkdir /scrapperserver
# set working dir
WORKDIR /scrapperserver
# copy contents on current directory into WORKDIR
ADD . /scrapperserver
# create virtual env for the application
RUN apt-get update && \
apt-get install -y curl git python3-venv && \
curl https://pyenv.run | bash
ENV PATH="/root/.pyenv/shims:/root/.pyenv/bin:$PATH"
RUN pyenv install 3.12.3 && \
pyenv global 3.12.3 && \
pip install --upgrade pip
RUN python -m venv .pyconfig
RUN . .pyconfig/bin/activate
# Run requirements.txt
RUN pip install -r requirements.txt
# Run the application (with manage.py commands)
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]