-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 1.23 KB
/
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
37
38
# Pull python base image
FROM python:3.10-slim
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get -y install libpq-dev gcc && apt-get install git -y --no-install-recommends
ARG CI
RUN if [ "$CI" = "ENABLED" ]; then \
apt-get update; \
apt-get install lsb-release gnupg2 wget -y --no-install-recommends; \
apt-cache search postgresql | grep postgresql; \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'; \
wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - ; \
apt -y update; \
apt-get install postgresql-15 -y --no-install-recommends; \
fi
# Installing requirements
COPY requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip && pip install -r /tmp/requirements.txt
# Copy Project to the container
RUN mkdir -p /fyle-partner-dashboard-api
COPY . /fyle-partner-dashboard-api/
WORKDIR /fyle-partner-dashboard-api
# Do linting checks
RUN pylint --load-plugins pylint_django --rcfile=.pylintrc **/**.py
# Expose development port
EXPOSE 8000
# Run development server
CMD /bin/bash run.sh