/ Dockerfile
Dockerfile
1 # This Dockerfile is used for builds on Railway. For all other purposes, use the generic `Dockerfile.dockerhub` in root dir. 2 3 FROM node:24 4 5 ENV NODE_ENV=production 6 7 # Usually, DO NOT set these in the Dockerfile. This is only for building the image in Railway. 8 9 ARG PUBLIC_PINATA_GATEWAY_URL 10 11 ARG INFURA_KEY 12 ARG ALCHEMY_KEY 13 ARG FILECOIN_KEY 14 15 ARG PINATA_SDK_KEY 16 ARG PINATA_SDK_SECRET 17 18 ARG TENDERLY_USER 19 ARG TENDERLY_PROJECT 20 ARG TENDERLY_ACCESS_SECRET 21 22 ARG GELATO_API_KEY 23 24 ARG PUBLIC_NETWORK 25 26 ARG COINMARKETCAP_API_KEY 27 28 ARG GITHUB_PERSONAL_ACCESS_TOKEN 29 30 ARG ETHERSCAN_API_KEY 31 32 ARG PUBLIC_GQL_URL 33 ARG PUBLIC_INTERNAL_GQL_URL 34 35 ARG CACHE_REDIS_CONNECTION_STRING 36 37 ARG PUBLIC_BASE_URL 38 39 ARG MULTIPLAYER_API_URL 40 ARG MULTIPLAYER_API_ACCESS_TOKEN 41 42 ARG MEILISEARCH_HOST 43 ARG MEILISEARCH_API_KEY 44 45 ARG FILECOIN_BLOCKSCOUT_API_KEY 46 ARG OPTIMISM_BLOCKSCOUT_API_KEY 47 48 ARG ECOSYSTEM_API_URL 49 ARG ECOSYSTEM_API_ACCESS_TOKEN 50 51 WORKDIR /app 52 53 ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 54 ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium 55 56 ARG PUBLIC_USE_LOCAL_TESTNET_WALLET_STORE 57 ARG PUBLIC_SUPPRESS_MISSING_VAR_IN_PROD_ERRORS 58 ARG LOCAL_TESTNET_RPC_URL 59 ARG FAKE_PINATA_URL 60 61 ARG PUBLIC_JUNCTION_URL 62 ARG PUBLIC_INTERNAL_JUNCTION_URL 63 64 ARG OTEL_EXPORTER_OTLP_ENDPOINT 65 ARG OTEL_SERVICE_NAME 66 67 ARG PUBLIC_FARO_ENABLED 68 ARG PUBLIC_FARO_ENVIRONMENT 69 70 ARG FARO_UPLOAD_SOURCE_MAPS_KEY 71 72 ARG PUBLIC_DRIPS_RPGF_URL 73 ARG PUBLIC_INTERNAL_DRIPS_RPGF_URL 74 75 ARG PUBLIC_ORCID_API_URL 76 77 ARG PUBLIC_WAVE_API_URL 78 ARG PUBLIC_INTERNAL_WAVE_API_URL 79 ARG PUBLIC_WAVE_GITHUB_APP_NAME 80 81 ARG PUBLIC_INTERCOM_APP_ID 82 83 ARG PUBLIC_NOVU_APP_ID 84 85 ARG INTERCOM_ACCESS_TOKEN 86 87 ARG PUBLIC_TURNSTILE_SITE_KEY 88 89 ARG PROJECT_CLAIM_API_URL 90 91 ARG PUBLIC_PRELUDE_SDK_KEY 92 93 RUN apt-get update \ 94 && apt-get install -y chromium \ 95 fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ 96 --no-install-recommends 97 98 # Install necessary dependencies for Puppeteer's Chrome 99 # These dependencies are required to run Puppeteer/Chrome in a headless environment 100 # The contrib.list changes for ttf-mscorefonts-installer 101 RUN apt-get install -y wget chromium 102 # Set the Chrome repo. 103 104 # Copies both package.json and package-lock.json 105 COPY package*.json ./ 106 # Install dependencies 107 RUN npm ci --ignore-scripts --include=dev; 108 109 # Copy the rest of the application's code into the container 110 COPY . . 111 112 # Make entire ./scripts folder executable 113 RUN chmod +x ./scripts/* 114 115 RUN npm run postinstall 116 117 # Set up robots 118 119 # Fetch GQL schema from API at `PUBLIC_GQL_URL` and save it to schema.graphql for type generation. 120 RUN npm run gql:generate-schema 121 122 # This relies on schema.graphql file being present in the root dir. 123 RUN npm run gql:build-types 124 125 # While building the app, we set dummy values for GQL_URL so that the build passes. When running the image these need to be set in env 126 RUN npm run build:app 127 128 RUN npm run build:telemetry 129 130 EXPOSE 8080 131 132 # Run the app (this is not a build command, it runs /build/index.js) 133 CMD ["node", "--require", "./build/telemetry.cjs", "build"]