Skip to content

Commit

Permalink
Compose: Update CCDScan deployment
Browse files Browse the repository at this point in the history
- Upgraded backend image in test- and mainnet env files.
- Migrated to gRPC APIv2.
- Fixed websocket URL (use 'ws', not 'wss').
- Clarified use of custom Nuxt config.
- Upgraded TimescaleDB image (the old one threw error "function round(double precision, integer) does not exist").
- Cleaned up minor things that looked like unintentional leftovers (such as dead ARG and comments) or are no longer relevant (such as cloning submodules).
  • Loading branch information
bisgardo committed Feb 19, 2024
1 parent 0be7d4a commit 275cf7f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions ccdscan/frontend.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Except for usage in FROM, these ARGs need to be redeclared in the contexts that they're used in.
# Except for usage in FROM, toplevel ARGs need to be redeclared in the contexts that they're used in.
# Default values defined here will still apply if they're not overridden.
ARG git_repo_url='https://github.com/Concordium/concordium-scan.git'
ARG tag='main'
Expand All @@ -12,7 +12,6 @@ RUN git \
-c advice.detachedHead=false \
clone \
--branch="${tag}" \
--recurse-submodules \
--depth=1 \
"${git_repo_url}" \
.
Expand All @@ -21,16 +20,17 @@ RUN git \
FROM node:16-slim AS build
WORKDIR /build
COPY --from=source /source/frontend .
ARG network
RUN yarn install
# Replace Nuxt config with one that sets preset "node-server" (instead of Firebase) and uses backend from the local deployment.
COPY ./nuxt.config.ts .
# Note that 'ENVIRONMENT' is hardcoded in the custom Nuxt config.
# The value is only used for resolving backend URLs which we hardcode
# and for controlling on which network to enable "developer" features that we just want to be always enabled.
RUN yarn build
ENTRYPOINT ["node", "./.output/server/index.mjs"]

# Serve artifacts.
FROM node:16-slim
# Override config with patched version that enables 'mod_rewrite'.
WORKDIR /target
COPY --from=build /build/.output .
ENTRYPOINT ["node", "./server/index.mjs"]
4 changes: 2 additions & 2 deletions ccdscan/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default defineNuxtConfig({
],
publicRuntimeConfig: {
apiUrl: 'http://localhost:5000/graphql',
wsUrl: 'wss://localhost:5000/graphql',
wsUrl: 'ws://localhost:5000/graphql',
environment: 'dev', // enables some error reporting or something
includeDevTools: false,
includeDevTools: true,
},
nitro: {
// Should be "node-server", but that doesn't work with the current dependency versions
Expand Down
7 changes: 3 additions & 4 deletions docker-compose.ccdscan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ services:
context: ./ccdscan
dockerfile: ./frontend.Dockerfile
args:
tag: main
network: ${NETWORK}
tag: frontend/${CCDSCAN_FRONTEND_VERSION}
ccdscan_backend:
image: ${CCDSCAN_BACKEND_IMAGE}
ports:
- "5000:5000"
environment:
- ImportValidation__Enabled=false
- ConcordiumNodeGrpc__AuthenticationToken=rpcadmin
- ConcordiumNodeGrpc__Address=http://node:10000
- ConcordiumNodeGrpc__Address=http://node:11000
- PostgresDatabase__ConnectionString=
Host=ccdscan_timescaledb;
Port=5432;
Expand All @@ -52,7 +51,7 @@ services:
restart: unless-stopped # it seems like startup sometimes fails because the DB isn't ready yet
# TODO Connect to external DB by default and enable this with another override.
ccdscan_timescaledb:
image: ${CCDSCAN_TIMESCALEDB_IMAGE-timescale/timescaledb:latest-pg13}
image: ${CCDSCAN_TIMESCALEDB_IMAGE-timescale/timescaledb:latest-pg14}
environment:
- POSTGRES_PASSWORD=password
networks:
Expand Down
6 changes: 4 additions & 2 deletions mainnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ ROSETTA_IMAGE=concordium/rosetta:1.1.0-1
ROSETTA_NETWORK=${NETWORK}

# CCDScan (not enabled by default).
CCDSCAN_FRONTEND_IMAGE=bisgardo/ccdscan-frontend:${NETWORK}
CCDSCAN_BACKEND_IMAGE=concordium/ccdscan:1.2.0-0
CCDSCAN_FRONTEND_VERSION=1.5.38
CCDSCAN_BACKEND_VERSION=1.8.14-1
CCDSCAN_FRONTEND_IMAGE=ccdscan-frontend:${CCDSCAN_FRONTEND_VERSION}
CCDSCAN_BACKEND_IMAGE=concordium/ccdscan:${CCDSCAN_BACKEND_VERSION}
6 changes: 4 additions & 2 deletions testnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ ROSETTA_IMAGE=concordium/rosetta:1.1.0-1
ROSETTA_NETWORK=${NETWORK}

# CCDScan (not enabled by default).
CCDSCAN_FRONTEND_IMAGE=bisgardo/ccdscan-frontend:${NETWORK}
CCDSCAN_BACKEND_IMAGE=concordium/ccdscan:1.2.0-0
CCDSCAN_FRONTEND_VERSION=1.5.38
CCDSCAN_BACKEND_VERSION=1.8.14-1
CCDSCAN_FRONTEND_IMAGE=ccdscan-frontend:${CCDSCAN_FRONTEND_VERSION}
CCDSCAN_BACKEND_IMAGE=concordium/ccdscan:${CCDSCAN_BACKEND_VERSION}

0 comments on commit 275cf7f

Please sign in to comment.