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