-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile-cli
More file actions
35 lines (24 loc) · 865 Bytes
/
Dockerfile-cli
File metadata and controls
35 lines (24 loc) · 865 Bytes
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
FROM registry.gitlab.ics.muni.cz:443/cryton/cryton/production-base:latest AS base
# Set environment
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
WORKDIR /app
# Install dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry install --without dev --no-root --no-interaction --no-ansi -E cli
# Install app
COPY . .
RUN poetry install --only-root --no-interaction --no-ansi -E cli
FROM python:3.12-alpine AS production
# Set environment
ENV CRYTON_APP_DIRECTORY=/app
# Install necessary packages
RUN apk add --no-cache \
bash
# Copy app
COPY --from=base /app /app
# Make the executable accessible
RUN ln -s /app/.venv/bin/cryton-cli /usr/local/bin/cryton-cli
# Enable shell autocompletion
RUN _CRYTON_CLI_COMPLETE=bash_source cryton-cli > /etc/profile.d/cryton-cli-complete.sh
RUN echo ". /etc/profile.d/cryton-cli-complete.sh" >> ~/.bashrc
CMD [ "bash" ]