-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (29 loc) · 1.18 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
# Pull python base image
FROM python:3.11-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 flake8
# Copy Project to the container
RUN mkdir -p /fyle-sage-desktop-api
COPY . /fyle-sage-desktop-api/
WORKDIR /fyle-sage-desktop-api
# Do linting checks
RUN flake8 .
# Expose development port
EXPOSE 8000
# Run development server
CMD /bin/bash run.sh