Skip to content

Commit

Permalink
Addresses #809: Include data directory contents during container imag…
Browse files Browse the repository at this point in the history
…e build. (#810)

* Addresses #809: Include data directory contents during container image build.

* rename file

---------

Co-authored-by: Jesse Abramowitz <[email protected]>
  • Loading branch information
vitropy and JesseAbram authored May 3, 2024
1 parent 16ba123 commit bfef77e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ RUN addgroup --system entropy \
# Lastly, we copy our own files into the final container image stage.
COPY --from=build --chown=entropy:entropy --chmod=554 /usr/local/bin/${PACKAGE} /usr/local/bin/${PACKAGE}
COPY --chown=entropy:entropy --chmod=554 bin/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --chown=entropy:entropy --chmod=444 data/ /srv/entropy/data

# Don't run as the `root` user within the container.
USER entropy
Expand Down
7 changes: 7 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Data

This directory holds static data used during development, build, or run, or test time for Entropy.

Subdirectories in this directory map to an environment in which the data is relevant. For example:

* `./testnet/testnet-accounts.json` - Accounts endowed with a starting balance at the Entropy Network's testnet genesis block.
File renamed without changes.
5 changes: 2 additions & 3 deletions node/cli/src/endowed_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ pub fn endowed_accounts_dev() -> Vec<AccountId> {
let mut externally_endowed_accounts: Vec<String> = Vec::new();
let project_root = get_project_root();
if let Ok(project_root) = project_root {
let mut file =
File::open(project_root.join("node/cli/src/chain_spec/testnet-accounts.json"))
.expect("unable to open testnet-accounts.json");
let mut file = File::open(project_root.join("data/testnet/testnet-accounts.json"))
.expect("unable to open testnet-accounts.json");
let mut data = String::new();
file.read_to_string(&mut data).expect("Unable to read file");
let mut incoming_accounts: Vec<String> =
Expand Down

0 comments on commit bfef77e

Please sign in to comment.