Skip to content

Commit 76c1b12

Browse files
committed
fix dockerfile
1 parent 62bc162 commit 76c1b12

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ ENV npm_config_cache=/npm-cache
2323
ENV ZOKRATES_HOME /app
2424
ENV ZOKRATES_STDLIBv8 /app/stdlibv8
2525
ENV ZOKRATES_STDLIB /app/stdlib
26+
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+
2637
# Copy app files
2738
COPY config/default.js config/default.js
2839
COPY package.json package-lock.json ./
@@ -35,13 +46,6 @@ COPY start-script ./start-script
3546
COPY start-dev ./start-dev
3647
RUN mkdir -p /app/output
3748
RUN mkdir -p /app/circuits
38-
# Install npm packages as root
39-
RUN npm i
40-
# Change/Add permission to user $USERNAME
41-
RUN groupadd --gid 10001 $USERNAME && \
42-
useradd --gid 10001 --uid 10001 --home /app --shell /bin/bash $USERNAME && \
43-
chown -R $USERNAME:$USERNAME /app /npm-cache /app
44-
# Switch to user $USERNAME from root
45-
USER $USERNAME:$USERNAME
49+
4650
EXPOSE 80
4751
CMD npm start

0 commit comments

Comments
 (0)