Skip to content
Snippets Groups Projects
Commit 417fbad5 authored by David Trattnig's avatar David Trattnig
Browse files

refact: build docker image using Poetry #30

parent b93f1190
No related branches found
No related tags found
No related merge requests found
.travis.yaml
.swagger-codegen-ignore
README.md
tox.ini
git_push.sh
test-requirements.txt
......
FROM python:3.9-slim
LABEL maintainer="David Trattnig <david.trattnig@subsquare.at>"
# Initialize the project structure
# System Dependencies
RUN mkdir -p /srv
RUN mkdir -p /var/log/aura
RUN apt-get update && apt-get -y install \
apt-utils \
build-essential \
pip
RUN python3 -m pip install --upgrade pip
RUN pip install poetry
# Copy sources and install
COPY . /srv
WORKDIR /srv
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir -r contrib/postgresql-requirements.txt
ENV PYTHONPATH "${PYTHONPATH}:/srv/src"
# Construct Image
# Create default config
RUN mkdir -p /srv
RUN mkdir -p /srv/src
RUN mkdir -p /srv/config
RUN mkdir -p /var/log/aura
COPY src /srv/src
COPY ./config/sample/gunicorn/sample-docker.gunicorn.conf.py /srv/config/gunicorn.conf.py
COPY ./config/sample/sample-docker.engine-api.ini /srv/config/engine-api.ini
COPY pyproject.toml /srv
COPY poetry.lock /srv
COPY README.md /srv
COPY Makefile /srv
# Start the API Server
WORKDIR /srv
RUN poetry install --without dev --no-interaction
EXPOSE 8008
ENTRYPOINT ["bash"]
CMD ["./run.sh", "prod"]
# Start Service
EXPOSE 8008
ENTRYPOINT ["make"]
CMD ["run"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment