-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·34 lines (26 loc) · 899 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
FROM python:3.11.1
# TODO change to multi-stage docker image (base, dev, prod)
# Keeps Python from generating .pyc files
ENV PYTHONDONTWRITEBYTECODE=1
# Effecient container logging
ENV PYTHONUNBUFFERED 1
RUN apt-get update \
&& apt-get install -y postgresql
# Install Poetry
COPY ./scripts .
ENV POETRY_HOME=/poetry
RUN python get-poetry.py --version 1.2.0
ENV PATH="$POETRY_HOME/bin:$PATH"
RUN poetry config virtualenvs.create false
# Install Deps
# Install any dependencies, this step will be cached so long as pyproject.toml is unchanged
ADD poetry.lock pyproject.toml /app/code/
WORKDIR /app/code
RUN poetry install
# Install the project itself (this is almost never cached)
COPY . /app/code
# Add custom commands (not django manage.py commands, but custom CLI QoL)
RUN chmod +x commands/*
ENV PATH="commands:${PATH}"
EXPOSE 8000
CMD ["poetry shell"]