-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker compose configurations (#11)
- Loading branch information
Hironori Yamamoto
authored
Jan 3, 2023
1 parent
2d7b9f2
commit f3b56a6
Showing
40 changed files
with
154 additions
and
78 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,7 @@ | ||
LOG_LEVEL=INFO | ||
REDASH_API_BASE_URL= | ||
REDASH_API_KEY= | ||
NEXT_PUBLIC_REDASH__URL=${REDASH__URL} | ||
OPEN_SEARCH__URL=http://localhost:9200 | ||
OPEN_SEARCH__USERNAME=admin | ||
OPEN_SEARCH__PASSWORD=admin |
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 +1,18 @@ | ||
# Redash Searcher | ||
|
||
Web application for searching Redash queries. | ||
Queries are stored in OpenSearch and synchronized with Redash periodically. | ||
|
||
## Start Up | ||
|
||
:pencil2: Copy `.env.sample` to `.env.docker` and edit it. | ||
|
||
```console | ||
cp .env.sample .env.docker | ||
``` | ||
|
||
:rocket: Start up containers. | ||
|
||
```console | ||
docker compose up | ||
``` |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
redash-search-sync/Cargo.lock → redash-searcher-sync/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
redash-search-sync/Cargo.toml → redash-searcher-sync/Cargo.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "redash-search-sync" | ||
name = "redash-searcher-sync" | ||
|
||
edition = "2021" | ||
version = "0.1.0" | ||
|
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,41 @@ | ||
# ref: https://dev.to/rogertorres/first-steps-with-docker-rust-30oi | ||
FROM rust:1.66.0-bullseye as build | ||
|
||
RUN USER=root cargo new --bin redash-searcher-sync | ||
WORKDIR /redash-searcher-sync | ||
|
||
# copy over your manifests | ||
COPY ./Cargo.lock ./Cargo.lock | ||
COPY ./Cargo.toml ./Cargo.toml | ||
|
||
# this build step will cache your dependencies | ||
RUN cargo build --release | ||
RUN rm src/*.rs | ||
|
||
# copy your source tree | ||
COPY ./src ./src | ||
|
||
# build for release | ||
RUN rm ./target/release/deps/redash_searcher_sync* | ||
RUN cargo build --release | ||
|
||
# our final base | ||
FROM debian:bullseye-slim | ||
|
||
|
||
RUN addgroup --system --gid 1001 redash-searcher | ||
RUN adduser --system --uid 1001 redash-searcher-sync | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y ca-certificates \ | ||
&& update-ca-certificates \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# copy the build artifact from the build stage | ||
COPY --from=build --chown=redash-searcher-sync:redash-searcher /redash-searcher-sync/target/release/redash-searcher-sync . | ||
|
||
USER redash-searcher-sync | ||
|
||
# set the startup command to run your binary | ||
ENTRYPOINT ["./redash-searcher-sync"] |
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,10 @@ | ||
#!/bin/sh | ||
# This is workaround to set public environment variables from runtime | ||
# ref: https://dev.to/itsrennyman/manage-nextpublic-environment-variables-at-runtime-with-docker-53dl | ||
|
||
echo "Check that we have NEXT_PUBLIC_REDASH__URL vars" | ||
test -n "$NEXT_PUBLIC_REDASH__URL" | ||
|
||
find /app/.next \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#APP_NEXT_PUBLIC_REDASH__URL#$NEXT_PUBLIC_REDASH__URL#g" | ||
|
||
exec "$@" |
File renamed without changes.
5 changes: 0 additions & 5 deletions
5
redash-search-web/next.config.js → redash-searcher-web/next.config.js
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
2 changes: 1 addition & 1 deletion
2
redash-search-web/package.json → redash-searcher-web/package.json
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,5 +1,5 @@ | ||
{ | ||
"name": "redash-search-web", | ||
"name": "redash-searcher-web", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
|
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.