Skip to content

Commit e8a292c

Browse files
authored
Staging fix 5 (#2904)
1 parent ee25aaf commit e8a292c

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Dockerfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ EXPOSE 3000
55
COPY package.json /usr/src/app/package.json
66
COPY yarn.lock /usr/src/app/yarn.lock
77
COPY ./server/ /usr/src/app/server
8-
COPY ./scripts/get-config-types.ts /usr/src/app/scripts/get-config-types.ts
8+
COPY ./scripts/get-config-types.js /usr/src/app/scripts/get-config-types.js
99
COPY ./blockchain/abi/*.json /usr/src/app/blockchain/abi/
1010

1111
WORKDIR /usr/src/app
1212

13+
ARG CONFIG_URL=''
14+
ENV CONFIG_URL=$CONFIG_URL
15+
16+
RUN yarn --no-progress --non-interactive --frozen-lockfile
17+
1318
ARG COMMIT_SHA='' \
1419
NOTIFICATIONS_HOST='' \
1520
NOTIFICATIONS_HOST_GOERLI='' \
@@ -30,8 +35,7 @@ ARG COMMIT_SHA='' \
3035
PRODUCT_HUB_KEY='' \
3136
ONE_INCH_API_KEY='' \
3237
ONE_INCH_API_URL='' \
33-
REFERRAL_SUBGRAPH_URL='' \
34-
CONFIG_URL=''
38+
REFERRAL_SUBGRAPH_URL=''
3539

3640
ENV COMMIT_SHA=$COMMIT_SHA \
3741
NOTIFICATIONS_HOST=$NOTIFICATIONS_HOST \
@@ -57,14 +61,11 @@ ENV COMMIT_SHA=$COMMIT_SHA \
5761
ONE_INCH_API_KEY=$ONE_INCH_API_KEY \
5862
ONE_INCH_API_URL=$ONE_INCH_API_URL \
5963
REFERRAL_SUBGRAPH_URL=$REFERRAL_SUBGRAPH_URL \
60-
CONFIG_URL=$CONFIG_URL \
6164
NODE_OPTIONS=--max-old-space-size=6144
6265

63-
RUN yarn --no-progress --non-interactive --frozen-lockfile
64-
6566
COPY . .
6667

6768
RUN chmod +x ./scripts/wait-for-it.sh \
6869
&& npm run build
6970

70-
CMD [ "npm", "run", "start:prod" ]
71+
CMD [ "npm", "run", "start:prod" ]

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"scripts": {
99
"start": "yarn get-config-types && next dev",
10-
"get-config-types": "npx ts-node scripts/get-config-types.ts",
10+
"get-config-types": "node scripts/get-config-types.js",
1111
"start:debug": "NODE_OPTIONS='--inspect' next dev",
1212
"start:prod": "yarn migrate && next start",
1313
"start:preview": "yarn build:8gb && next start -p 3000",

scripts/get-config-types.ts scripts/get-config-types.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import dotenv from 'dotenv'
2-
import { mkdir, readdir, writeFile } from 'fs/promises'
3-
import JsonToTS from 'json-to-ts'
4-
import fetch from 'node-fetch'
5-
import { join } from 'path'
1+
const dotenv = require('dotenv')
2+
const { mkdir, readdir, writeFile } = require('fs/promises')
3+
const JsonToTS = require('json-to-ts')
4+
const fetch = require('node-fetch')
5+
const { join } = require('path')
6+
67
dotenv.config({
78
path: '.env',
89
})
@@ -11,11 +12,11 @@ dotenv.config({
1112
})
1213

1314
const getConfig = async () => {
14-
const response = await fetch(process.env.CONFIG_URL as string)
15+
const response = await fetch(process.env.CONFIG_URL)
1516
return await response.json()
1617
}
1718

18-
const getInterfaces = (configObject: { features: {} } = { features: {} }) => {
19+
const getInterfaces = (configObject = { features: {} }) => {
1920
try {
2021
const interfaces = JsonToTS(configObject)
2122
.map((typeInterface) => {

0 commit comments

Comments
 (0)