-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 931 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
35
36
FROM python:3.9-slim-buster
# Install dependencies
RUN apt-get update && apt-get install -y \
libpq-dev \
python3-dev \
build-essential \
cron \
postgresql-client \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
# Create the log file to be able to run tail
RUN touch /var/log/cron.log
# Test cron job
# RUN crontab -l | { cat; echo "* * * * * echo 'Hello world' >> /var/log/cron.log 2>&1"; } | crontab -
# Create static and media folders
RUN mkdir -p /www/app/staticfiles && \
mkdir -p /www/app/media
WORKDIR /usr/app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY requirements.txt /usr/app/requirements.txt
RUN pip install --upgrade pip \
&& pip install -r /usr/app/requirements.txt
## entry point bash script
COPY ./entrypoint.sh /usr/app/entrypoint.sh
RUN chmod +x /usr/app/entrypoint.sh
## start the entrypoint bash script
ENTRYPOINT ["sh", "/usr/app/entrypoint.sh"]