-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
33 lines (23 loc) · 1.03 KB
/
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
FROM python:3.12-slim-bullseye
RUN apt-get -y update \
&& apt-get -y install --no-install-recommends curl tini \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV PYTHONDONTWRITEBYTECODE="1" PYTHONIOENCODING="UTF-8" PYTHONUNBUFFERED="1"
# dir and user setup
ENV USER="faucet"
RUN adduser --disabled-password $USER
USER $USER
ENV APP_DIR="/home/$USER/faucet"
WORKDIR $APP_DIR
RUN python3 -m pip install --no-cache-dir poetry \
&& echo "export PATH=$PATH:$HOME/.local/bin" >> $HOME/.bashrc
COPY --chown=$USER:$USER poetry.lock pyproject.toml ./
# install project dependencies
RUN $HOME/.local/bin/poetry install --without=dev
# copy project code
COPY --chown=$USER:$USER faucet_rgb ./faucet_rgb
COPY --chown=$USER:$USER migrations ./migrations
COPY --chown=$USER:$USER issue_asset.py wallet_helper.py LICENSE README.md ./
EXPOSE 8080/tcp
HEALTHCHECK CMD curl localhost:8080 || exit 1
CMD ["tini", "--", "/home/faucet/.local/bin/poetry", "run", "waitress-serve", "--host=0.0.0.0", "--call", "faucet_rgb:create_app"]