Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for running in Docker #28

Merged
merged 5 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Debian 12 image
FROM amd64/julia:1.9.2-bookworm

WORKDIR /app
COPY . .

CMD ["bash"]
USER root

# Needed to build Blink.jl (dep for PlotlyJS.jl)
RUN apt-get update
RUN apt-get install --no-install-recommends unzip

# Set API environment variable
ARG api_key
ENV env_key $api_key

# Install dependencies
RUN julia -e 'using Pkg; Pkg.activate(pwd()); Pkg.instantiate()'

# Run the app
CMD ["julia", "src/docker_app.jl"]

# Expose port to access the web page
EXPOSE 8010
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CryptoDashApp"
uuid = "8f55a569-a1ee-45d2-b761-b2b316ddd8e9"
authors = ["Vikas Negi <vikas.negi10@gmail.com>"]
version = "0.4.1"
version = "0.4.2"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Functionality of the app will be extended in the future by adding more technical

## How to use?

### Running in Julia locally
This package is available via the General registry. Add it to your working Julia environment by
doing the following in the REPL:
* Press ']' to enter Pkg prompt
Expand All @@ -37,6 +38,27 @@ Free API key can be obtained from [here.](https://www.alphavantage.co/support/#a

Now, open a new tab in your browser and check if you can access http://0.0.0.0:8056/ or http://127.0.0.1:8056/

### Running as a Docker container
Assuming that you have Docker installed, and a valid API key, a Docker image
can be created using the follwing steps:
* Clone this repository and cd to the directory

* Build the Docker image (Here `crypto_app` is the name of the generated image)
```bash
docker build --build-arg api_key=<YOUR_API_KEY> -t crypto_app .
```

* Once the image is successfully generated, start a container (port 8010 is hard-coded
in the Dockerfile, can also be changed if needed):
```bash
docker run -dp 127.0.0.1:8010:8010 crypto_app
```

* Check log output:
```bash
docker logs --follow <container id>
```

First plot will take a few seconds to appear, wait patiently! If you are running this app for the
first time, or on a different date, new data will be retrieved from Alpha Vantage, and then saved
to CSV files on disk. Keep in mind that the free API key imposes a limit of five calls/minute,
Expand Down
1,001 changes: 0 additions & 1,001 deletions data/ADA_EUR_data_2023-03-12.csv

This file was deleted.

1,001 changes: 1,001 additions & 0 deletions data/ADA_EUR_data_2023-08-20.csv

Large diffs are not rendered by default.

1,001 changes: 1,001 additions & 0 deletions data/DOT_EUR_data_2023-08-20.csv

Large diffs are not rendered by default.

1,001 changes: 0 additions & 1,001 deletions data/ETC_EUR_data_2023-03-12.csv

This file was deleted.

1,001 changes: 1,001 additions & 0 deletions data/ETC_EUR_data_2023-08-20.csv

Large diffs are not rendered by default.

1,001 changes: 0 additions & 1,001 deletions data/ETH_EUR_data_2023-03-12.csv

This file was deleted.

1,001 changes: 1,001 additions & 0 deletions data/ETH_EUR_data_2023-08-20.csv

Large diffs are not rendered by default.

1,001 changes: 1,001 additions & 0 deletions data/KNC_EUR_data_2023-08-20.csv

Large diffs are not rendered by default.

1,001 changes: 0 additions & 1,001 deletions data/LINK_EUR_data_2023-03-12.csv

This file was deleted.

Loading
Loading