Skip to content

Commit

Permalink
Merge branch 'release/v2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnuj committed Jun 8, 2023
2 parents bc93ad5 + cd43369 commit df04855
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
COMPOSE_PROJECT_NAME=localterra
TERRA_VERSION=2.4.0
TERRA_VERSION=2.3.2
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10
- 'v[0-9]+.[0-9]+.[0-9]+-rc*' # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
- 'v[0-9]+.[0-9]+.[0-9]+-classic' # Push events to matching v*, i.e. v1.0-classic, v20.15.10-classic

jobs:
artifacts:
Expand Down
50 changes: 43 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,56 @@
ARG TERRA_VERSION=2.3.1
ARG TERRA_VERSION=2.3.2

FROM ghcr.io/terra-money/core:${TERRA_VERSION}

# Set up fo nginx
USER root

COPY --chmod=644 nginx.conf /etc/nginx/nginx.conf
COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh

RUN apk add --no-cache nginx && \
mkdir -p /var/lib/nginx/logs && \
chown -R terra:terra /var/lib/nginx && \
ln -sf /dev/stdout /var/lib/nginx/logs/access.log && \
ln -sf /dev/stderr /var/lib/nginx/logs/error.log

# Setup for localterra
RUN set -eux &&\
mkdir -p /app/conifg && \
mkdir -p /app/data && \
chown -R terra:terra /app && \
terrad init localterra --home /app --chain-id localterra && \
echo '{"height": "0","round": 0,"step": 0}' > /app/data/priv_validator_state.json && \
sed -e '/^\[api\]/,/\[rosetta\]/ s|^enable *=.*|enable = true|' \
-e '/^\[api\]/,/\[rosetta\]/ s|^swagger *=.*|swagger = true|' \
-e '/^\[api\]/,/\[rosetta\]/ s|^enabled-unsafe-cors *=.*|enabled-unsafe-cors = true|' \
-i /app/config/app.toml

COPY ./terra/genesis.json \
./terra/priv_validator_key.json \
/app/config/

RUN mkdir -p /app/data && \
echo '{"height": "0","round": 0,"step": 0}' > /app/data/priv_validator_state.json
ENTRYPOINT [ "entrypoint.sh" ]

# rest server
EXPOSE 1317
# nginx
EXPOSE 8080
# grpc
EXPOSE 9090
# grpc-web
EXPOSE 9091
# tendermint p2p
EXPOSE 26656
# tendermint rpc
EXPOSE 26657

CMD terrad start \
--api.enable true \
--api.enabled-unsafe-cors true \
--api.swagger true \
--home /app \
--minimum-gas-prices 0.015uluna \
--moniker localterra \
--p2p.upnp true \
--rpc.laddr tcp://0.0.0.0:26657
--rpc.laddr tcp://0.0.0.0:26657 \
--api.enable true \
--api.swagger true \
--api.enabled-unsafe-cors true
5 changes: 5 additions & 0 deletions docker-compose-reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

docker-compose rm -f -s -v
docker volume rm localterra_terra
docker-compose build --no-cache
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
- default
ports:
- "1317:1317"
- "8080:8080"
- "9090:9090"
- "9091:9091"
- "26657:26657"
Expand Down
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -eux

# Start the nginx process
nginx -g "daemon off;" &

exec "$@"
2 changes: 0 additions & 2 deletions initdb.d/init.sql

This file was deleted.

44 changes: 44 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
events {}
http {
include mime.types;
default_type application/octet-stream;

server {
listen 8080;
location / {
rewrite ^/$ /swagger/? permanent;
proxy_pass http://127.0.0.1:1317;

if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
# Om nom nom cookies
#
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,baggage,sentry-trace';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,baggage,sentry-trace';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,baggage,sentry-trace';
}
}
}
}

0 comments on commit df04855

Please sign in to comment.