-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.14 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (33 loc) · 1.14 KB
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
39
40
41
42
# SPDX-FileCopyrightText: Magenta ApS <https://magenta.dk>
# SPDX-License-Identifier: MPL-2.0
FROM python:3.11
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_VERSION="1.8" \
POETRY_HOME=/opt/poetry \
VIRTUAL_ENV="/venv"
ENV PATH="$VIRTUAL_ENV/bin:$POETRY_HOME/bin:$PATH"
RUN apt update && apt install -y vim jq less screen
# Install poetry in an isolated environment
RUN python -m venv $POETRY_HOME \
&& pip install --no-cache-dir poetry==${POETRY_VERSION}
# Install project in another isolated environment
RUN python -m venv $VIRTUAL_ENV
COPY pyproject.toml poetry.lock* ./
RUN poetry install --no-root
COPY alembic.ini ./alembic.ini
COPY alembic ./alembic
COPY docker/start.sh ./docker/start.sh
COPY scripts ./scripts
COPY sdtoolplus ./sdtoolplus
RUN install -m 755 /app/scripts/sd-sync.sh /usr/local/bin/sd-sync
ENV ENVIRONMENT=production \
RUN_ALEMBIC_MIGRATIONS=true
CMD ["./docker/start.sh"]
# Add build version to the environment last to avoid build cache misses
ARG COMMIT_TAG
ARG COMMIT_SHA
ENV COMMIT_TAG=${COMMIT_TAG:-HEAD} \
COMMIT_SHA=${COMMIT_SHA}