-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile.dev
94 lines (67 loc) · 2.74 KB
/
Dockerfile.dev
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
# Based on the solution posted further down from
# https://www.answeroverflow.com/m/1210080779267481670#solution-1210102172117631027
# Augmented for development (including docker run command) based on the solution here:
# https://stackoverflow.com/questions/78305121/hmr-in-a-sveltekit-vite-project-using-docker-docker-compose
# Use the official Node.js 22 image as a base
FROM node:22
# Set host environment variables
# Based on .env.template
# See https://docs.railway.app/guides/dockerfiles#using-variables-at-build-time
ARG PUBLIC_PINATA_GATEWAY_URL
ARG INFURA_KEY
ARG ALCHEMY_KEY
ARG FILECOIN_KEY
ARG E2E_HEADLESS
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 GQL_URL
ARG GQL_ACCESS_TOKEN
ARG CACHE_REDIS_CONNECTION_STRING
ARG PUBLIC_BASE_URL
ARG MULTIPLAYER_API_URL
ARG MULTIPLAYER_API_ACCESS_TOKEN
# Set environment variables to optimize the container
ENV NODE_ENV development
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH "/usr/bin/google-chrome-stable"
# 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 update && \
apt-get install -y wget gnupg2 ca-certificates apt-transport-https software-properties-common && \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
echo "deb http://deb.debian.org/debian bookworm contrib non-free" > /etc/apt/sources.list.d/contrib.list && \
apt-get update && \
apt-get install -y google-chrome-stable ttf-mscorefonts-installer fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
# Set working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json .
# Install dependencies, including 'puppeteer'
RUN npm i --ignore-scripts
# Copy the rest of the application's code into the container
COPY . .
# Run the post install script
RUN npm run postinstall
# Install husky globally to run the prepare script
RUN npm install husky@9 -g
RUN npm run prepare
# Set up robots
RUN mv robots-disallow.txt ./static/robots.txt
# Build graphql types
RUN npm run build:graphql
# Expose the app port
EXPOSE 5173
# Specify the command to run the app
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]