Skip to content

Commit

Permalink
updated dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-afegbua committed Feb 19, 2024
1 parent 09b8804 commit 8288609
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
38 changes: 24 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
# syntax = docker/dockerfile:1.3

# Always add commit hash for reproducability
FROM node:18-alpine@sha256:3482a20c97e401b56ac50ba8920cc7b5b2022bfc6aa7d4e4c231755770cf892f

# Enable prod optimizations
# Set environment variables
ENV NODE_ENV=production

# Create app directory
WORKDIR /app
RUN apk add --update --no-cache g++ make python3 && \
ln -sf python3 /usr/bin/python && \
apk add --update --no-cache yarn

COPY ["package.json", "yarn.lock", "./"]
RUN yarn install --frozen-lockfile --production
COPY . /app
# Install dependencies
RUN apk add --update --no-cache \
g++ \
make \
python3 \
yarn \
tini && ln -sf python3 /usr/bin/python

# Copy package.json and yarn.lock
COPY package.json yarn.lock ./

# Install app dependencies
RUN yarn install --production

# Copy the rest of the application
COPY . ./

# make sure we can write the data directory
RUN chown node:node data
RUN chown -R node:node /app/data \
&& chmod -R 755 /app/data

# Add a simple init system so that Node would respect process signals
RUN apk add --no-cache tini
# Use tini as the entrypoint
ENTRYPOINT ["/sbin/tini", "--"]

# Don't run as root
USER node
CMD ["node", "main.js" ]

# Start the application
CMD ["node", "main.js"]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"dependencies": {
"@decentral.ee/web3-helpers": "^0.5.3",
"@slack/webhook": "^6.1.0",
"@superfluid-finance/ethereum-contracts": "1.9.1-dev.083b723.0",
"@superfluid-finance/metadata": "^1.1.27",
"@superfluid-finance/ethereum-contracts": "1.9.0",
"@superfluid-finance/metadata": "1.1.27",
"async": "^3.2.4",
"axios": "^1.4.0",
"bip39": "^3.1.0",
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1096,10 +1096,10 @@
dependencies:
antlr4ts "^0.5.0-alpha.4"

"@superfluid-finance/[email protected].1-dev.083b723.0":
version "1.9.1-dev.083b723.0"
resolved "https://npm.pkg.github.com/download/@superfluid-finance/ethereum-contracts/1.9.1-dev.083b723.0/c4cfdfe8887c5f754f46258534d63328748803a3#c4cfdfe8887c5f754f46258534d63328748803a3"
integrity sha512-0wW+yPGhioW/p0cGJj5NPAl9zk30SGo2XHNCnXgFrNqBQg+h2LIie1O18K5B+aE1lNHHsY4bG0izHNd6zrRRgw==
"@superfluid-finance/[email protected]":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@superfluid-finance/ethereum-contracts/-/ethereum-contracts-1.9.0.tgz#e3bc894bb39a730cc9f6c2bbb7f3fa449191112b"
integrity sha512-1ZPaZjc2wCgeADIAB6jRe+3p7c1S4oDfsUXg3+nAsEflMdvujncJzl1vUHjoC4sGIObZ9voYowYP9WuRoaPSug==
dependencies:
"@decentral.ee/web3-helpers" "0.5.3"
"@nomiclabs/hardhat-ethers" "^2.2.3"
Expand All @@ -1109,9 +1109,9 @@
ethereumjs-util "7.1.5"
hardhat "^2.19.4"

"@superfluid-finance/metadata@^1.1.27":
"@superfluid-finance/[email protected]":
version "1.1.27"
resolved "https://npm.pkg.github.com/download/@superfluid-finance/metadata/1.1.27/24df39277e6eb27201765693bbc47ce4c93befb6#24df39277e6eb27201765693bbc47ce4c93befb6"
resolved "https://registry.yarnpkg.com/@superfluid-finance/metadata/-/metadata-1.1.27.tgz#24df39277e6eb27201765693bbc47ce4c93befb6"
integrity sha512-61Dj7zcncPLSyqhWowj6Xmb6xeeT9b5Yjg4lAhnFIk1XCiycxrgsWc7aokbm4On3dLRg3xBiacy6qoG2rSaM5A==

"@szmarczak/http-timer@^4.0.5":
Expand Down

0 comments on commit 8288609

Please sign in to comment.