-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
403 changed files
with
36,740 additions
and
25,318 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,4 @@ tsconfig.tsbuildinfo | |
# Ceramic daemon | ||
ipfs | ||
packages/backend/uploads/ | ||
*.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
lts/gallium | ||
lts/iron |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"githubPullRequests.ignoredPullRequestBranches": [ | ||
"develop" | ||
] | ||
} | ||
{ | ||
"githubPullRequests.ignoredPullRequestBranches": [ | ||
"develop" | ||
], | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
nodeLinker: node-modules | ||
|
||
preferInteractive: true | ||
|
||
progressBarStyle: simba | ||
|
||
checksumBehavior: update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,88 @@ | ||
FROM node:20-slim as base | ||
FROM node:20-slim AS base | ||
WORKDIR /usr/src/app | ||
|
||
# varying arg to prevent caching | ||
# ARG CACHEBUST | ||
|
||
# Install dependencies not included in the slim image | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends g++ make python3 git openssl && \ | ||
apt-get install -y --no-install-recommends --reinstall ca-certificates | ||
|
||
# Install dependencies for dev and prod | ||
COPY package.json . | ||
COPY lerna.json . | ||
COPY yarn.lock . | ||
COPY schema.graphql . | ||
COPY tsconfig.base.json . | ||
COPY package.json ./ | ||
COPY lerna.json ./ | ||
COPY yarn.lock ./ | ||
COPY schema.graphql ./ | ||
COPY tsconfig.base.json ./ | ||
COPY packages/backend/*.json ./packages/backend/ | ||
COPY packages/utils/*.json ./packages/utils/ | ||
COPY packages/discord-bot/*.json ./packages/discord-bot/ | ||
# Not needed for the backend, but the --immutable flag fails w/o them | ||
COPY packages/design-system/package.json ./packages/design-system/ | ||
COPY packages/web/package.json ./packages/web/ | ||
|
||
RUN corepack enable | ||
RUN yarn config set nodeLinker node-modules | ||
RUN yarn install --immutable | ||
|
||
RUN yarn install --pure-lockfile | ||
# RUN set -x && echo $CACHEBUST && ls -la | ||
|
||
# Dev environment doesn't run this stage or beyond | ||
FROM base as build | ||
# Dev environment doesn't run beyond here | ||
FROM base AS build | ||
|
||
# Copy source files | ||
COPY packages/backend ./packages/backend/ | ||
COPY packages/utils ./packages/utils/ | ||
COPY packages/discord-bot ./packages/discord-bot/ | ||
COPY packages/@types ./packages/@types/ | ||
COPY packages/backend/ ./packages/backend/ | ||
COPY packages/utils/ ./packages/utils/ | ||
COPY packages/discord-bot/ ./packages/discord-bot/ | ||
COPY packages/@types/ ./packages/@types/ | ||
|
||
# Set env vars | ||
ARG GRAPHQL_HOST=hasura | ||
ARG GRAPHQL_DOMAIN=onrender.com | ||
ARG GRAPHQL_URL=https://$GRAPHQL_HOST.$GRAPHQL_DOMAIN/v1/graphql | ||
ARG THE_GRAPH_API_TOKEN=unspecified | ||
ARG GRAPHQL_HOST | ||
ARG GRAPHQL_DOMAIN | ||
ARG GRAPHQL_URL | ||
ARG THE_GRAPH_API_TOKEN | ||
|
||
ENV GRAPHQL_URL $GRAPHQL_URL | ||
ENV HASURA_GRAPHQL_ADMIN_SECRET metagame_secret | ||
ENV THE_GRAPH_API_TOKEN $THE_GRAPH_API_TOKEN | ||
ENV GRAPHQL_URL=$GRAPHQL_URL | ||
ENV HASURA_GRAPHQL_ADMIN_SECRET=metagame_secret | ||
ENV THE_GRAPH_API_TOKEN=$THE_GRAPH_API_TOKEN | ||
|
||
# Build | ||
RUN yarn backend:build | ||
|
||
# Delete devDependencies | ||
RUN yarn install --pure-lockfile --production --ignore-scripts --prefer-offline | ||
#RUN corepack enable | ||
# RUN yarn workspaces focus @metafam/backend --production # --immutable | ||
# RUN yarn install --immutable | ||
# RUN yarn install --pure-lockfile --production --ignore-scripts --prefer-offline | ||
|
||
# Create completely new stage including only necessary files | ||
FROM node:20-slim as app | ||
FROM node:20-slim AS app | ||
WORKDIR /app | ||
|
||
ARG CACHEBUST | ||
|
||
# Copy necessary files into the stage | ||
COPY --from=build /usr/src/app/package.json ./package.json | ||
COPY --from=build /usr/src/app/node_modules ./node_modules | ||
COPY --from=build /usr/src/app/yarn.lock ./ | ||
COPY --from=build /usr/src/app/package.json ./ | ||
#COPY --from=build /usr/src/app/node_modules ./ | ||
|
||
COPY --from=build /usr/src/app/packages/backend/package.json ./packages/backend/ | ||
COPY --from=build /usr/src/app/packages/backend/dist/ ./packages/backend/dist/ | ||
#COPY --from=build /usr/src/app/packages/backend/node_modules ./packages/backend/ | ||
# RUN mkdir -p ./packages/backend/node_modules | ||
|
||
COPY --from=build /usr/src/app/packages/utils/package.json ./packages/utils/ | ||
COPY --from=build /usr/src/app/packages/utils/dist/ ./packages/utils/dist/ | ||
#COPY --from=build /usr/src/app/packages/utils/node_modules ./packages/utils/ | ||
|
||
COPY --from=build /usr/src/app/packages/discord-bot/package.json ./packages/discord-bot/ | ||
COPY --from=build /usr/src/app/packages/discord-bot/dist/ ./packages/discord-bot/dist/ | ||
|
||
COPY --from=build /usr/src/app/packages/backend/package.json ./packages/backend/package.json | ||
COPY --from=build /usr/src/app/packages/backend/dist ./packages/backend/dist | ||
COPY --from=build /usr/src/app/packages/backend/node_modules ./packages/backend/node_modules | ||
RUN corepack enable | ||
RUN yarn config set nodeLinker node-modules | ||
RUN yarn workspaces focus @metafam/backend --production # --immutable | ||
RUN yarn cache clean | ||
|
||
COPY --from=build /usr/src/app/packages/utils/package.json ./packages/utils/package.json | ||
COPY --from=build /usr/src/app/packages/utils/dist ./packages/utils/dist | ||
COPY --from=build /usr/src/app/packages/utils/node_modules ./packages/utils/node_modules | ||
RUN echo $CACHEBUST && ls -la packages/*/ | ||
|
||
COPY --from=build /usr/src/app/packages/discord-bot/package.json ./packages/discord-bot/package.json | ||
COPY --from=build /usr/src/app/packages/discord-bot/dist ./packages/discord-bot/dist | ||
|
||
CMD ["yarn", "backend", "start"] | ||
CMD ["yarn", "workspace", "@metafam/backend", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.