-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
38 lines (29 loc) · 1.24 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 && pip install pylint-django==2.3.0
# Copy Project to the container
RUN mkdir -p /fyle-intacct-api
COPY . /fyle-intacct-api/
WORKDIR /fyle-intacct-api
# Do linting checks
RUN pylint --load-plugins pylint_django --rcfile=.pylintrc apps/**.py
# Expose development port
EXPOSE 8000
# Run development server
CMD /bin/bash run.sh