-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 1020 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
35
36
FROM python:3.9
# Don't periodically check PyPI to determine whether a new version of pip is available for download.
ENV PIP_DISABLE_PIP_VERSION_CHECK=on \
# Disable package cache.
PIP_NO_CACHE_DIR=off \
# The python output is sent straight to terminal (e.g. your container log) without being first buffered
PYTHONUNBUFFERED=on \
# Prevents python creating .pyc files
PYTHONDONTWRITEBYTECODE=on \
# set workdir as PYTHON PATH
PYTHONPATH=/code \
# to run scripts
PATH="app/scripts:${PATH}"
RUN apt-get update && apt-get install -y --no-install-recommends build-essential\
&& apt-get autoclean && apt-get autoremove \
&& pip install poetry \
&& poetry config virtualenvs.create false
# don't have to create direcotry with mkdir
WORKDIR /code
# requirements (poetry)
COPY ./poetry.lock poetry.lock
COPY ./pyproject.toml pyproject.toml
RUN poetry install
COPY ./app app
COPY ./Makefile Makefile
COPY ./init_db.py init_db.py
RUN python init_db.py
ENTRYPOINT []