Skip to content

Commit

Permalink
chore[docker]: install new submodule via Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
sk33z3r committed May 8, 2022
1 parent 8673bf4 commit 7666902
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ ADD minter/requirements.txt /minter.txt
ADD minter/hello_loopring/requirements.txt /hello_loopring.txt
RUN pip install -r /generator.txt -r /hello_loopring.txt -r /minter.txt

FROM node:16-alpine as node_modules
FROM node:16 as node_modules
# Set workdir initially just for npm to install
WORKDIR /usr/src/app
# Install the app from npm directly
RUN npm i --only=production pure-ipfs-only-hash
# Install container pre-requisites
RUN apt-get -y update; \
apt-get -y upgrade
RUN apt-get -y install python3
# Install modules
ADD ipfs-hash/package*.json ./
RUN npm install
# Install app files
ADD ipfs-hash/* ./

FROM python:3.9
# install npm and ffmpeg
Expand All @@ -25,11 +32,11 @@ RUN apt-get update; \
RUN apt-get install -y npm ffmpeg
# 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/node_modules /usr/src/app/node_modules
COPY --from=node_modules /usr/src/app /usr/src/app
# add the python files for the game
ADD dockerfiles/scripts/* /usr/local/bin/
# link cid calculator
RUN ln -s /usr/src/app/node_modules/pure-ipfs-only-hash/cli.js /usr/bin/cid
RUN ln -s /usr/src/app/cli.js /usr/bin/cid
# finish up container
WORKDIR /app

Expand Down

0 comments on commit 7666902

Please sign in to comment.