-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.cli
executable file
·35 lines (32 loc) · 1.12 KB
/
Dockerfile.cli
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 python:3.9-alpine3.15 AS python_modules
# add openssh and clean
RUN apk --no-cache --update add build-base jpeg-dev libffi-dev
# install python modules
ADD python/requirements.txt /generator.txt
ADD python/hello_loopring/requirements.txt /hello_loopring.txt
RUN pip install -r /generator.txt -r /hello_loopring.txt
FROM node:16-alpine3.15 as node_modules
# Set workdir initially just for npm to install
WORKDIR /usr/src/app
# Install modules
ADD ipfs-hash/package*.json ./
RUN npm install --omit=dev
RUN npm install --location=global pkg
# Install app files, compile to native binary
ADD ipfs-hash/* ./
RUN pkg ./cli.js -o ./ipfs-cid-linux
FROM python:3.9-alpine3.15
# define workdir
WORKDIR /loopygen
# install python3.9 and ffmpeg
RUN apk --no-cache --update add ffmpeg bash
# get compiled modules from previous stages
COPY --from=python_modules /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=node_modules /usr/src/app/ipfs-cid-linux /usr/bin/cid
# add scripts
ADD dockerfiles/scripts/* /usr/local/bin/
# add app files
ADD ./python ./python
ADD ./.version ./.version
RUN mkdir -p ./php && touch php/progress.json
CMD ["bash"]