-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
103 additions
and
10 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
COMPOSE_PROJECT_NAME=localterra | ||
TERRA_VERSION=2.4.0 | ||
TERRA_VERSION=2.3.2 |
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 |
---|---|---|
@@ -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 |
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 @@ | ||
#!/bin/sh | ||
|
||
docker-compose rm -f -s -v | ||
docker volume rm localterra_terra | ||
docker-compose build --no-cache |
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ services: | |
- default | ||
ports: | ||
- "1317:1317" | ||
- "8080:8080" | ||
- "9090:9090" | ||
- "9091:9091" | ||
- "26657:26657" | ||
|
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,8 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
# Start the nginx process | ||
nginx -g "daemon off;" & | ||
|
||
exec "$@" |
This file was deleted.
Oops, something went wrong.
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,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'; | ||
} | ||
} | ||
} | ||
} | ||
|