-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDockerfile
37 lines (28 loc) · 927 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
37
# Python 3.8 Release
FROM python:3.8.1-alpine as development
# Maintainer Information
LABEL maintainer="Giovanni Armane <[email protected]>"
LABEL license="MIT"
# Set environment variables
ENV PYTHON_VERSION=3.8.1 \
APP_PATH=/home/python/app \
POETRY_VIRTUALENVS_CREATE=false \
PATH=/home/python/.local/lib/python3.8/site-packages:/usr/local/bin:/home/python:/home/python/app/bin:$PATH
# Install and configure dependencies
RUN apk add --no-cache build-base libressl-dev musl-dev libffi-dev postgresql-dev
RUN pip install --no-cache-dir poetry
# Configure user, groups and working directory for application
RUN adduser -u 1000 -D python && \
mkdir -p /home/python/app
# Set workdir
WORKDIR /home/python/app
# Copy project file and pre-install
COPY pyproject.toml .
COPY poetry.lock .
RUN poetry install
# Expose ports
EXPOSE 5000
# Declare volumes
VOLUME [ "/home/python/app" ]
# Run the app
CMD ["ash"]