forked from hicdex/hicdex
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.pytezos
34 lines (26 loc) · 1.14 KB
/
Dockerfile.pytezos
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
# Temporary copy for dockerhub
FROM python:3.10-slim-buster
ARG PLUGINS=pytezos
SHELL ["/bin/bash", "-x", "-v", "-c"]
RUN apt update && \
apt install -y make git sudo `if [[ $PLUGINS =~ "pytezos" ]]; then echo build-essential pkg-config libsodium-dev libsecp256k1-dev libgmp-dev; fi` && \
rm -rf /var/lib/apt/lists/*
RUN pip install poetry
RUN useradd -ms /bin/bash dipdup
RUN mkdir /home/dipdup/source
COPY --chown=dipdup Makefile pyproject.toml poetry.lock README.md /home/dipdup/source/
# We want to copy our code at the last layer but not to break poetry's "packages" section
RUN mkdir -p /home/dipdup/source/src/dipdup && \
touch /home/dipdup/source/src/dipdup/__init__.py
WORKDIR /home/dipdup/source
RUN poetry config virtualenvs.create false
RUN make install DEV=0 PLUGINS="${PLUGINS}"
COPY --chown=dipdup inject_pyproject.sh /home/dipdup/inject_pyproject
RUN chmod +x /home/dipdup/inject_pyproject
RUN echo 'dipdup ALL = NOPASSWD: /home/dipdup/inject_pyproject' >> /etc/sudoers
COPY --chown=dipdup src /home/dipdup/source/src
USER dipdup
RUN poetry config virtualenvs.create false
WORKDIR /home/dipdup/
ENTRYPOINT ["dipdup"]
CMD ["run"]