mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
* beginning ESM transition: Ceramic libraries, Next.js, & TypeScript configuration 🇭🇰 * updating Chakra, React, & Next image `import`s 👔 * upgrading `@types/react`, import extensions for Node, & b64 SVG to PNG ⛹🏿♀️ * fixing relative import names & upddating @types packages 📻 * removoing WYSIWYG editor, draft-js, & updating express ⛹🏿♀️ * updating OpenSea 🚲 * ¡@metafam/utils is building! 📰 * ¡Discord bot is building! 👘 * ¡backend is building! 🛩 * fixed everything but Ceramic DID update 🏍 * switching to DID:PKH 📦 * fixing "only one child allowed" error 🙇🏿♀️ * importing `React` as required by tsc's `isolatedModules` 🇲🇰 * disabling testing rather than taking the time to fix jest ⚜ * removing set `types` from `tsconfig` to fix compilation error 🥦 * printing tests disabled warning, hopefully 🙀 * setting file to be copied to the new resolver 👁️🗨️ * "paths-resolver" not "paths-resolve" 🦴 * switching back to relative paths rather than trying to fix `paths` ⏳ * `yarn backend:dev` not working, testing GitHub build 🎺 * removing design system build & fixing some images ✊🏿 * fixed "expected function got string" error & trying to address undefined HTMLElement 🐡 * fixing @emotion/react tree shaking by making external 🏏 * including eslint config in Dockerfile 🌾 * fixing more images 🎯 * updating DIDs & switching back to an updated DID:3 ❇ * switching to w3s.link gateway & fixing early termination of storage endpoint 🔭 * switching back to ipfs.io gateway b/c w3s.link serves SVGs as application/xml which are CORB blocked 🥾 * fixing node config name in eslint ignore & shortening some paths 🧰 * fixing ts-node not handling project references 🥁
65 lines
2.2 KiB
Docker
65 lines
2.2 KiB
Docker
FROM node:16-slim as base
|
|
WORKDIR /usr/src/app
|
|
|
|
# Install dependencies not included in the slim image
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends g++ make python 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 packages/backend/*.json ./packages/backend/
|
|
COPY packages/utils/*.json ./packages/utils/
|
|
COPY packages/discord-bot/*.json ./packages/discord-bot/
|
|
|
|
RUN yarn install --pure-lockfile
|
|
|
|
# Dev environment doesn't run this stage or beyond
|
|
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/
|
|
|
|
# Set env vars
|
|
ARG GRAPHQL_HOST=hasura
|
|
ARG GRAPHQL_DOMAIN=onrender.com
|
|
ARG GRAPHQL_URL=https://$GRAPHQL_HOST.$GRAPHQL_DOMAIN/v1/graphql
|
|
|
|
ENV GRAPHQL_URL $GRAPHQL_URL
|
|
ENV HASURA_GRAPHQL_ADMIN_SECRET metagame_secret
|
|
ENV CERAMIC_URL https://ceramic.metagame.wtf
|
|
|
|
# Build
|
|
RUN yarn backend:build
|
|
|
|
# Delete devDependencies
|
|
RUN yarn install --pure-lockfile --production --ignore-scripts --prefer-offline
|
|
|
|
# Create completely new stage including only necessary files
|
|
FROM node:16-alpine as app
|
|
WORKDIR /app
|
|
|
|
# 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/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
|
|
|
|
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
|
|
|
|
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"]
|