-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: graceful shutdown; logging fix; small image-90MB
- Loading branch information
Showing
10 changed files
with
115 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,53 @@ | ||
FROM python:3.10.4-buster | ||
FROM python:3.12.6-slim AS builder | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y ca-certificates | ||
# Install compilation dependencies for Ubuntu including ca-certificates, libffi, and libsodium | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
libffi-dev \ | ||
libsodium-dev \ | ||
libssl-dev \ | ||
python3-dev \ | ||
python3-venv \ | ||
python3-pip \ | ||
curl | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Setup Rust for blake3 dependency build | ||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y | ||
|
||
WORKDIR /vLEI | ||
|
||
RUN python -m venv venv | ||
ENV PATH=/vLEI/venv/bin:${PATH} | ||
RUN pip install --upgrade pip | ||
|
||
COPY requirements.txt setup.py /vLEI/ | ||
RUN mkdir /vLEI/src | ||
|
||
# Build vLEI-server | ||
RUN . "$HOME/.cargo/env" && \ | ||
pip install -r requirements.txt | ||
|
||
# Create smaller runner image by copying over built binary | ||
FROM python:3.12.6-slim AS runner | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y libsodium23 | ||
|
||
# Prevents Python from buffering stdout and stderr, logs to stdout immediately | ||
ENV PYTHONUNBUFFERED=1 | ||
# Set default encoding to UTF-8 | ||
ENV PYTHONIOENCODING=UTF-8 | ||
|
||
WORKDIR /usr/local/var/ | ||
RUN git clone https://github.com/WebOfTrust/vLEI | ||
WORKDIR /vLEI | ||
|
||
COPY --from=builder /vLEI /vLEI | ||
COPY src/ src/ | ||
COPY ./schema/acdc /vLEI/schema | ||
COPY ./samples/acdc /vLEI/credentials | ||
COPY ./samples/oobis /vLEI/oobis | ||
|
||
ENV PATH=/vLEI/venv/bin:${PATH} | ||
|
||
WORKDIR /usr/local/var/vLEI | ||
RUN pip install -r requirements.txt | ||
CMD ["vLEI-server", "-s", "/vLEI/schema", "-c", "/vLEI/credentials", "-o", "/vLEI/oobis"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
__version__ = '0.1.1' # also change in setup.py | ||
__version__ = '0.2.1' # also change in setup.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters