-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (30 loc) · 1.33 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
39
# Pull python base image
FROM python:3.10-slim
# install the requirements from the requirements.txt file via git
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
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# 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-admin-settings
COPY . /fyle-integrations-settings-api/
WORKDIR /fyle-integrations-settings-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