-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: fly.toml * docs: deploy to fly.io * fix: Dockerfile fly.io * fix: monika dockerfly io
- Loading branch information
1 parent
495fe70
commit 323ddc3
Showing
5 changed files
with
95 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 |
---|---|---|
|
@@ -232,3 +232,6 @@ monika.yaml | |
|
||
# IntelliJ | ||
.idea/ | ||
|
||
# Fly.io | ||
fly.toml |
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,18 @@ | ||
FROM node:14-alpine | ||
|
||
RUN apk add --no-cache --virtual .gyp python3 make g++ | ||
|
||
# Setup environment variables | ||
ARG PARAMS | ||
ENV PARAMS=${PARAMS} | ||
ENV CI=true | ||
|
||
# Install Monika | ||
USER node | ||
RUN mkdir /home/node/.npm-global | ||
ENV PATH=/home/node/.npm-global/bin:$PATH | ||
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | ||
RUN npm install -g @hyperjumptech/monika | ||
|
||
# Run Monika with Params | ||
CMD ["sh", "-c", "${NPM_CONFIG_PREFIX}/bin/monika ${PARAMS}"] |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
id: deploy-to-fly-io | ||
title: Deploy to Fly.io | ||
--- | ||
|
||
This article covers how to deploy a Monika instance to Fly.io. | ||
|
||
1. Go to the [Monika Github repository](https://github.com/hyperjumptech/monika) and download two files: Dockerfile.flyio and fly.toml.example | ||
|
||
2. Rename the `fly.toml.example` to fly.toml`. | ||
|
||
3. Edit the contents of the fly.toml: | ||
|
||
```toml | ||
app = "monika" # Change the app name to the desired name | ||
|
||
kill_signal = "SIGINT" | ||
kill_timeout = 5 | ||
|
||
[build] | ||
dockerfile = "Dockerfile.flyio" | ||
|
||
[build.args] | ||
PARAMS = "-v" # Change the parameters according to your needs | ||
|
||
[env] | ||
PARAMS = "-v" # Match the content of this PARAMS variable to the one in `build.args` block | ||
|
||
[experimental] | ||
auto_rollback = true | ||
``` | ||
|
||
Refer to the [Fly.io App Configuration Docs](https://fly.io/docs/reference/configuration/) to customize the example TOML even further. | ||
|
||
4. Install [Fly.io CLI tools](https://fly.io/docs/flyctl/installing/) (`flyctl`) in your computer | ||
|
||
5. a. Proceed to authenticate to Fly.io by running `flyctl auth login` in your terminal. | ||
|
||
b. If you haven't signed up to Fly.io yet, you can sign up by running `flyctl auth signup` in your terminal. | ||
|
||
6. Create a new Fly.io app by running `flyctl apps create` and enter the app name according to your `fly.toml` you have created before. | ||
|
||
7. Deploy Monika to your Fly.io by running `flyctl deploy` | ||
|
||
8. Wait until the deployment is finished, and check Monika logs from the Fly.io dashboard to confirm that your Monika instance is running. |
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,18 @@ | ||
app = "monika" | ||
|
||
kill_signal = "SIGINT" | ||
kill_timeout = 5 | ||
|
||
[build] | ||
dockerfile = "Dockerfile.flyio" | ||
|
||
[build.args] | ||
# Insert your Monika parameters | ||
PARAMS = "-v" | ||
|
||
[env] | ||
# Insert your Monika parameters | ||
PARAMS = "-v" | ||
|
||
[experimental] | ||
auto_rollback = true |