Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
chore(docker): simplify docker file and do not return 503 after all c…
Browse files Browse the repository at this point in the history
…ontracts have failed to evaluate
  • Loading branch information
dtfiedler committed Jan 16, 2024
1 parent 35ce108 commit d86a7f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
11 changes: 2 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ WORKDIR /usr/src/app

# Add shell
COPY --from=busybox:1.35.0-uclibc /bin/sh /bin/sh
COPY --from=busybox:1.35.0-uclibc /bin/addgroup /bin/addgroup
COPY --from=busybox:1.35.0-uclibc /bin/adduser /bin/adduser
COPY --from=busybox:1.35.0-uclibc /bin/chown /bin/chown

# Create user
RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node
RUN chown -R node ./
USER node
COPY --from=busybox:1.35.0-uclibc /bin/chmod /bin/chmod

# Copy build files
COPY --from=builder --chown=node /usr/src/app .
COPY --from=builder /usr/src/app .

# Setup port
EXPOSE 3000
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
# Check and set permissions if necessary
if [ -d "/usr/src/app/cache" ]; then
echo "Setting permissions on /usr/src/app/cache"
chown -R node:node /usr/src/app/cache
chmod -R 755 /usr/src/app/cache
fi
Expand Down
4 changes: 3 additions & 1 deletion src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export const prefetchContracts = async () => {
endTimestamp,
durationMs: endTimestamp - startTimestamp,
});
return false;
// don't fail the entire prefetch operation if one contract fails
return true;
});
}),
).catch((error: unknown) => {
Expand All @@ -77,6 +78,7 @@ export const prefetchContracts = async () => {
error: message,
contractTxIds: prefetchContractTxIds,
});
// fail if anything throws
return [false];
});
// update our healthcheck flag
Expand Down

0 comments on commit d86a7f6

Please sign in to comment.