Skip to content

Commit 85e439c

Browse files
committed
fix dockerfile
1 parent 76c1b12 commit 85e439c

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Dockerfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ ENV ZOKRATES_HOME /app
2424
ENV ZOKRATES_STDLIBv8 /app/stdlibv8
2525
ENV ZOKRATES_STDLIB /app/stdlib
2626

27-
# Install npm packages as root
28-
RUN npm i
29-
30-
# Change/Add permission to user $USERNAME
31-
RUN groupadd --gid 10001 $USERNAME && \
32-
useradd --gid 10001 --uid 10001 --home /app --shell /bin/bash $USERNAME && \
33-
chown -R $USERNAME:$USERNAME /app /app/output /app/circuits /npm-cache
34-
# Switch to user $USERNAME from root
35-
USER $USERNAME:$USERNAME
36-
3727
# Copy app files
3828
COPY config/default.js config/default.js
3929
COPY package.json package-lock.json ./
@@ -44,8 +34,19 @@ COPY --from=builder /app/zoKrates/target/release/zokrates /app/zokrates
4434
COPY src ./src
4535
COPY start-script ./start-script
4636
COPY start-dev ./start-dev
37+
38+
# Install npm packages as root
39+
RUN npm i
40+
41+
# Change/Add permission to user $USERNAME
42+
RUN groupadd --gid 10001 $USERNAME && \
43+
useradd --gid 10001 --uid 10001 --home /app --shell /bin/bash $USERNAME && \
44+
chown -R $USERNAME:$USERNAME /app /app/output /app/circuits /npm-cache
45+
# Switch to user $USERNAME from root
46+
USER $USERNAME:$USERNAME
47+
48+
# Create directories
4749
RUN mkdir -p /app/output
48-
RUN mkdir -p /app/circuits
4950

5051
EXPOSE 80
5152
CMD npm start

0 commit comments

Comments
 (0)