-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
35 lines (26 loc) · 868 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
# pull official base image
FROM python:3.10-slim-buster
# set work directory
WORKDIR /usr/src/app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install mysql dependencies
RUN apt-get update
RUN apt-get install gcc default-libmysqlclient-dev -y
# install dependencies
RUN pip install -U pip setuptools wheel
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt --no-cache-dir
# copy project
COPY . .
# Convert plain text files from Windows or Mac format to Unix
RUN apt-get install dos2unix
RUN dos2unix --newfile docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
# Make entrypoint executable
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Entrypoint dependencies
RUN apt-get install netcat -y
# run entrypoint.sh
ENTRYPOINT ["bash", "/usr/local/bin/docker-entrypoint.sh"]