forked from ToolJet/ToolJet
-
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.
Chore: ToolJet setup to try locally (ToolJet#3158)
* add dockerfile for try tooljet setup * update npm scripts and logged messages * refactor npm scripts for dist folder scripts * update usages of db setup and seed * setup script to init db and boot app * fix dockerfile * update dockerfile * user production.Dockerfile as base image * fix script * fix script exit * fix lint
- Loading branch information
1 parent
5fdc7da
commit a13a2d4
Showing
12 changed files
with
135 additions
and
76 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
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,24 @@ | ||
FROM tooljet/tooljet-ce:latest | ||
|
||
# Install Postgres | ||
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | ||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list | ||
RUN apt update && apt -y install postgresql-13 postgresql-client-13 | ||
USER postgres | ||
RUN service postgresql start && \ | ||
psql -c "create role tooljet with login superuser password 'postgres';" | ||
|
||
# ENV defaults | ||
ENV TOOLJET_HOST=http://localhost:3000 \ | ||
LOCKBOX_MASTER_KEY=replace_with_lockbox_master_key \ | ||
SECRET_KEY_BASE=replace_with_secret_key_base \ | ||
PG_DB=tooljet_production \ | ||
PG_USER=tooljet \ | ||
PG_PASS=postgres \ | ||
PG_HOST=localhost \ | ||
ORM_LOGGING=true \ | ||
DEPLOYMENT_PLATFORM=docker:local \ | ||
TERM=xterm | ||
|
||
# Prepare DB and start application | ||
ENTRYPOINT service postgresql start 1> /dev/null && bash /app/server/scripts/init-db-boot.sh |
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,7 +1,11 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
npm run db:create | ||
npm run db:migrate | ||
if [ -d "./server/dist" ] | ||
then | ||
npm run db:setup:prod | ||
else | ||
npm run db:setup | ||
fi | ||
|
||
exec "$@" |
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
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
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,28 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "Initializing database.." | ||
echo "This may take a couple of minutes" | ||
echo -ne " (0%)\r" | ||
npm run db:create:prod --silent 1> /dev/null | ||
echo -ne "##### (33%)\r" | ||
npm run db:migrate:prod --silent 1> /dev/null | ||
echo -ne "############# (66%)\r" | ||
npm run db:seed:prod --silent | ||
echo -ne "####################### (100%)\r" | ||
echo -ne "\n\n" | ||
|
||
|
||
echo " | ||
_____ _ ___ _ | ||
|_ _| | | |_ | | | | ||
| | ___ ___ | | | | ___| |_ | ||
| |/ _ \ / _ \| | | |/ _ \ __| | ||
| | (_) | (_) | /\__/ / __/ |_ | ||
\_/\___/ \___/|_\____/ \___|\__| | ||
Everything you need to build internal tools! | ||
GitHub: https://github.com/ToolJet/ToolJet | ||
" | ||
|
||
npm run start:prod --silent |
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
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