Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisassad committed Sep 18, 2024
1 parent 687b237 commit df92bbb
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 33 deletions.
27 changes: 0 additions & 27 deletions Dockerfile.base

This file was deleted.

23 changes: 22 additions & 1 deletion Dockerfile.consumer
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
FROM base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS build
## needed for node-gyp to build
RUN apt-get update && \
apt-get install -y python3 make gcc g++
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth
RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build

FROM base AS commonwealth
ENV NODE_ENV=production
COPY --from=build /prod/commonwealth /prod/commonwealth
WORKDIR /prod/commonwealth
RUN apt-get update && apt-get install -y curl # Needed for heroku
ENV PORT=$PORT
CMD node --import=extensionless/register build/server/workers/commonwealthConsumer/commonwealthConsumer.js
23 changes: 22 additions & 1 deletion Dockerfile.evmCe
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
FROM base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS build
## needed for node-gyp to build
RUN apt-get update && \
apt-get install -y python3 make gcc g++
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth
RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build

FROM base AS commonwealth
ENV NODE_ENV=production
COPY --from=build /prod/commonwealth /prod/commonwealth
WORKDIR /prod/commonwealth
RUN apt-get update && apt-get install -y curl # Needed for heroku
ENV PORT=$PORT
CMD node --import=extensionless/register build/server/workers/evmChainEvents/startEvmPolling.js
23 changes: 22 additions & 1 deletion Dockerfile.knock
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
FROM base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS build
## needed for node-gyp to build
RUN apt-get update && \
apt-get install -y python3 make gcc g++
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth
RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build

FROM base AS commonwealth
ENV NODE_ENV=production
COPY --from=build /prod/commonwealth /prod/commonwealth
WORKDIR /prod/commonwealth
RUN apt-get update && apt-get install -y curl # Needed for heroku
ENV PORT=$PORT
CMD node --import=extensionless/register build/server/workers/knock/knockWorker.js
23 changes: 22 additions & 1 deletion Dockerfile.messageRelayer
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
FROM base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS build
## needed for node-gyp to build
RUN apt-get update && \
apt-get install -y python3 make gcc g++
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth
RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build

FROM base AS commonwealth
ENV NODE_ENV=production
COPY --from=build /prod/commonwealth /prod/commonwealth
WORKDIR /prod/commonwealth
RUN apt-get update && apt-get install -y curl # Needed for heroku
ENV PORT=$PORT
CMD node --import=extensionless/register build/server/workers/messageRelayer/messageRelayer.js
23 changes: 22 additions & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
FROM base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS build
## needed for node-gyp to build
RUN apt-get update && \
apt-get install -y python3 make gcc g++
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth
RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build

FROM base AS commonwealth
ENV NODE_ENV=production
COPY --from=build /prod/commonwealth /prod/commonwealth
WORKDIR /prod/commonwealth
RUN apt-get update && apt-get install -y curl # Needed for heroku
ENV PORT=$PORT
CMD node --import=extensionless/register build/server/scripts/releasePhaseEnvCheck.js && \
npx sequelize-cli db:migrate --config server/sequelize.json && \
node --import=extensionless/register build/server/scripts/purgeCloudflareCache.js
23 changes: 22 additions & 1 deletion Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
FROM base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS build
## needed for node-gyp to build
RUN apt-get update && \
apt-get install -y python3 make gcc g++
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth
RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build

FROM base AS commonwealth
ENV NODE_ENV=production
COPY --from=build /prod/commonwealth /prod/commonwealth
WORKDIR /prod/commonwealth
RUN apt-get update && apt-get install -y curl # Needed for heroku
ENV PORT=$PORT
CMD NODE_ENV=production node --import=extensionless/register --enable-source-maps ./build/service1-server.js

0 comments on commit df92bbb

Please sign in to comment.