-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerize Service to begin testing in prod (#23)
Dockerize service and have hasura front-end
- Loading branch information
Showing
3 changed files
with
99 additions
and
0 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,47 @@ | ||
FROM cosmwasm/wasmd:v0.18.0 as wasmd | ||
FROM cosmwasm/rust-optimizer:0.11.5 as rust-optimizer | ||
FROM ubuntu:20.04 | ||
FROM postgres:14 | ||
|
||
COPY --from=wasmd /usr/bin/wasmd /usr/local/bin/wasmd | ||
COPY --from=wasmd /opt/* /opt/ | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
ca-certificates curl file \ | ||
build-essential \ | ||
git \ | ||
gcc \ | ||
jq \ | ||
musl-tools \ | ||
autoconf automake autotools-dev libtool xutils-dev | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata | ||
RUN apt-get install -y postgresql-server-dev-14 postgresql-contrib | ||
|
||
ENV SSL_VERSION=1.0.2u | ||
|
||
RUN curl https://www.openssl.org/source/openssl-$SSL_VERSION.tar.gz -O && \ | ||
tar -xzf openssl-$SSL_VERSION.tar.gz && \ | ||
cd openssl-$SSL_VERSION && ./config && make depend && make install && \ | ||
cd .. && rm -rf openssl-$SSL_VERSION* | ||
|
||
ENV OPENSSL_LIB_DIR=/usr/local/ssl/lib \ | ||
OPENSSL_INCLUDE_DIR=/usr/local/ssl/include \ | ||
OPENSSL_STATIC=1 | ||
|
||
|
||
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y | ||
ENV PATH=/root/.cargo/bin:$PATH | ||
RUN rustup update stable \ | ||
&& rustup target add wasm32-unknown-unknown | ||
|
||
RUN cargo install diesel_cli --no-default-features --features "postgres" | ||
|
||
RUN git clone https://github.com/DA0-DA0/dao-contracts.git | ||
RUN mkdir /app | ||
ADD . /app | ||
WORKDIR /app | ||
RUN cargo build | ||
CMD cargo run | ||
|
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,51 @@ | ||
version: "3.9" | ||
|
||
services: | ||
db: | ||
container_name: indexer_db | ||
image: postgres:14 | ||
volumes: | ||
- ./data/db:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
ports: | ||
- '5432:5432' | ||
indexer: | ||
build: . | ||
command: bash -c "cargo install diesel_cli --no-default-features --features "postgres" && diesel setup && diesel migration run && cargo run" | ||
volumes: | ||
- .:/code | ||
network_mode: host | ||
environment: | ||
- POSTGRES_NAME=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- ENABLE_INDEXER=true | ||
- TENDERMINT_WEBSOCKET_URL=wss://rpc.uni.juno.deuslabs.fi/websocket | ||
- TENDERMINT_RPC_URL=https://rpc.uni.juno.deuslabs.fi | ||
- TENDERMINT_SAVE_ALL_BLOCKS=true | ||
- TENDERMINT_INITAL_BLOCK_HEIGHT=100000 | ||
- RUST_BACKTRACE=1 | ||
- DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres | ||
depends_on: | ||
- db | ||
graphql-engine: | ||
image: hasura/graphql-engine:v2.4.0 | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- db | ||
environment: | ||
## postgres database to store Hasura metadata | ||
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgres@indexer_db:5432/postgres | ||
## this env var can be used to add the above postgres database to Hasura as a data source. this can be removed/updated based on your needs | ||
PG_DATABASE_URL: postgres://postgres:postgres@indexer_db:5432/postgres | ||
## enable the console served by server | ||
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console | ||
## enable debugging mode. It is recommended to disable this in production | ||
HASURA_GRAPHQL_DEV_MODE: "true" | ||
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log | ||
## uncomment next line to set an admin secret | ||
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey |
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