-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 953 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
38
FROM python:3.12.3-bookworm
ARG VERSION=0.1.10
RUN useradd -ms /bin/bash huc
USER huc
WORKDIR /home/huc
ENV PYTHONPATH=/home/huc/huc-editor-service/src
ENV BASE_DIR=/home/huc/huc-editor-service
ENV BASE_URL=${BASE_URL:-"http://localhost:1210"}
RUN mkdir dev
ADD pyproject.toml dev/pyproject.toml
ADD README.md dev/README.md
ADD conf dev/conf
ADD data dev/data
ADD logs dev/logs
ADD resources dev/resources
ADD src dev/src
ADD tests dev/tests
RUN curl -sSL https://install.python-poetry.org | python -
RUN cd dev && \
${HOME}/.local/share/pypoetry/venv/bin/poetry install && \
${HOME}/.local/share/pypoetry/venv/bin/poetry update && \
${HOME}/.local/share/pypoetry/venv/bin/poetry build
RUN cp dev/dist/*.* .
#
RUN mkdir -p ${BASE_DIR} && \
pip install --no-cache-dir *.whl && rm -rf *.whl && \
tar xf huc_editor_service-${VERSION}.tar.gz -C ${BASE_DIR} --strip-components 1
WORKDIR ${BASE_DIR}
CMD ["python", "src/main.py"]