Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release-updated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Updated
on:
push:
branches:
- swati/updates
- lyd/dockerfileUpdates

jobs:
# define job to build and publish docker image
Expand Down Expand Up @@ -39,8 +39,8 @@ jobs:
# GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker push version
run: |
docker build --no-cache --build-arg GPR_TOKEN=$GPR_TOKEN -t ghcr.io/eyblockchain/zokrates-worker-updated:latest .
docker push ghcr.io/eyblockchain/zokrates-worker-updated:latest
docker build --no-cache --build-arg GPR_TOKEN=$GPR_TOKEN -t ghcr.io/eyblockchain/zokrates-worker-updated:v0.4 .
docker push ghcr.io/eyblockchain/zokrates-worker-updated:v0.4
env:
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Set up Docker Buildx
Expand Down
37 changes: 22 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# build zokrates from source for local verify
FROM rust:1.53.0 as builder

WORKDIR /app
COPY . .
RUN git clone --depth 1 --branch 0.8.8 https://github.com/Zokrates/ZoKrates /app/zoKratesv0.8.8
WORKDIR /app/zoKratesv0.8.8
RUN rustup install nightly-2022-06-28
RUN cargo +nightly-2022-06-28 build -p zokrates_cli --release

# Copy the built result into /app/zoKrates
RUN cp -r /app/zoKratesv0.8.8 /app/zoKrates


FROM ubuntu:24.10
FROM ubuntu:24.04
ENV USERNAME="app"
WORKDIR /app

# Install NodeJs
RUN apt-get update && \
apt-get install -y netcat-traditional curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs gcc g++ make && \
mkdir /npm-cache
# Setup environment variables
ENV npm_config_cache=/npm-cache
ENV ZOKRATES_HOME /app
ENV ZOKRATES_STDLIBv8 /app/stdlibv8
ENV ZOKRATES_STDLIB /app/stdlib
# Copy app files
COPY config/default.js config/default.js
COPY package.json package-lock.json ./
COPY --from=builder /app/zoKratesv0.8.8/zokrates_stdlib/stdlib /app/stdlibv8
Expand All @@ -24,17 +33,15 @@ COPY --from=builder /app/zoKrates/target/release/zokrates /app/zokrates
COPY src ./src
COPY start-script ./start-script
COPY start-dev ./start-dev

RUN apt-get update && apt-get install -y netcat-traditional curl
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs gcc g++ make

ENV ZOKRATES_HOME /app
ENV ZOKRATES_STDLIBv8 /app/stdlibv8
ENV ZOKRATES_STDLIB /app/stdlib

RUN mkdir -p /app/output
RUN mkdir -p /app/circuits
# Install npm packages as root
RUN npm i

# Change/Add permission to user $USERNAME
RUN groupadd --gid 10001 $USERNAME && \
useradd --gid 10001 --uid 10001 --home /app --shell /bin/bash $USERNAME && \
chown -R $USERNAME:$USERNAME /app /npm-cache /app/output /app/circuits
# Switch to user $USERNAME from root
USER $USERNAME:$USERNAME
EXPOSE 80
CMD npm start
Loading