Skip to content
Snippets Groups Projects
Commit 13b2a19b authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

build prod dockerfile

parent e9a15059
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,8 @@ CMD ["pnpm", "exec", "tsx", "src/indexer/start.ts"]
# TODO build image only for indexer without app
# TODO really build for node and not use tsx (is it necessary)
# build and run for test
# docker buildx build . -t test-datapod
# docker run --rm -it test-datapod
# build and run
# docker buildx build . -t h30x/duniter-datapod
# docker image push h30x/duniter-datapod
# docker run --rm -it h30x/duniter-datapod
# CMD ["pnpm", "exec", "tsx", "src/scripts/hello.ts"]
FROM hasura/graphql-engine:v2.38.1.cli-migrations-v3
COPY ./hasura/migrations /hasura-migrations
COPY ./hasura/metadata /hasura-metadata
# docker buildx build -f Dockerfile.Hasura . -t h30x/datapod-hasura
# docker image push h30x/datapod-hasura
\ No newline at end of file
FROM ipfs/kubo:v0.28.0
COPY ./scripts/remove-default-bootstrap.sh /container-init.d/001-remove-default-bootstrap.sh
CMD ["daemon", "--enable-pubsub-experiment"]
# docker buildx build -f Dockerfile.Kubo . -t h30x/datapod-kubo
# docker image push h30x/datapod-kubo
\ No newline at end of file
# prod compose file
services:
# ------
postgres:
image: postgres:16
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgrespassword}
POSTGRES_DB: ${DB_DATABASE:-postgres}
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres -d postgres']
interval: 1s
# ------
hasura:
image: h30x/datapod-hasura
depends_on:
postgres:
condition: service_healthy
restart: always
ports:
- '${HASURA_LISTEN_PORT:-8765}:8080'
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://${DB_USER:-postgres}:${DB_PASSWORD:-postgrespassword}@postgres:5432/${DB_DATABASE:-postgres}
HASURA_GRAPHQL_ENABLE_CONSOLE: true
HASURA_GRAPHQL_DEV_MODE: false
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: public
HASURA_GRAPHQL_ENABLE_TELEMETRY: false
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET:-my_hasura_secret}
# ------
kubo:
image: h30x/datapod-kubo
ports:
# p2p port public
- 4001:4001
- 4001:4001/udp
# public gateway
- 8080:8080
# expose RPC locally to allow access with ssh tunnel
- 127.0.0.1:5001:5001
volumes:
- kubo_data:/data/ipfs
healthcheck:
test: ['CMD', 'ipfs', 'diag', 'cmds']
interval: 1s
restart: always
# ------
datapod:
image: h30x/duniter-datapod
depends_on:
postgres:
condition: service_healthy
kubo:
condition: service_healthy
environment:
KUBO_RPC: "http://kubo:5001"
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-postgrespassword}
restart: always
volumes:
db_data:
kubo_data:
version: '3.6'
# development compose file
services:
postgres:
image: postgres:16
restart: always
ports:
- '5432:5432'
- '5432:5432' # expose db for indexer
volumes:
- db_data:/var/lib/postgresql/data
environment:
......@@ -16,13 +17,13 @@ services:
retries: 5
hasura:
image: hasura/graphql-engine:v2.38.1.cli-migrations-v3
image: hasura/graphql-engine:v2.38.1.cli-migrations-v3 # dev image to apply migrations
depends_on:
postgres:
condition: service_healthy
restart: always
ports:
- '${HASURA_LISTEN_PORT}:8080'
- '${HASURA_LISTEN_PORT}:8080' # because kubo gateway is already listening on 8080
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${DB_PASSWORD}@postgres:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE: true
......
#!/bin/sh
set -ex
ipfs bootstrap rm all
......@@ -3,7 +3,8 @@ import type { IPFSHTTPClient } from 'kubo-rpc-client'
import { CID } from 'multiformats'
// env
var process : NodeJS.Process | undefined = typeof(process) == "undefined" ? undefined : process
// TODO clean way to declare KUBO_RPC for Vue App
// var process : NodeJS.Process | undefined = typeof(process) == "undefined" ? undefined : process
const KUBO_RPC = process?.env.KUBO_RPC || 'http://127.0.0.1:5001'
const KUBO_GATEWAY = process?.env.KUBO_GATEWAY || 'http://127.0.0.1:8080'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment