-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (25 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Instructions:
# Download this file (you don't need anything else)
# Build: docker build -t crs .
# Generate keys if you don't have a valid pair :
# - [new keys] docker run -it --init crs generateJwks ES256
# - [using a privatekey in hex] docker run -it --init crs generateJwks ES256 8c2ebb279f950edec15d36f3d7b10a35858d9743f964489ec0ad8860e3e9423b
# Copy template.env to .env and fill all the required env variables.
# Run the Conflict Resolution Service: docker run -it --init -p 127.0.0.1:3000:3000 --env-file .env crs
FROM node:18-alpine
# VERSION can be used to build docker with a specific NPM version of the @i3m/conflict-resolver-service
ARG VERSION=${VERSION:-latest}
ENV NODE_ENV=${NODE_ENV:-production}
ENV CORS_ACCESS_CONTROL_ALLOW_ORIGIN=${CORS_ACCESS_CONTROL_ALLOW_ORIGIN:-*}
ENV CRS_PRIVATE_JWK=${CRS_PRIVATE_JWK} CRS_PUBLIC_JWK=${CRS_PUBLIC_JWK}
ENV RPC_PROVIDER_URL=${RPC_PROVIDER_URL}
WORKDIR /app
RUN chown node.node /app &&\
apk update &&\
apk upgrade
USER node
RUN mkdir .keys && \
npm install @i3m/conflict-resolver-service@${VERSION}
EXPOSE 3000
ENTRYPOINT [ "npx" ]
CMD [ "crs" ]