-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from ItzNotABug/dockerize-ghosler
Dockerize `Ghosler`
- Loading branch information
Showing
10 changed files
with
277 additions
and
170 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# build files | ||
.idea/ | ||
.vscode/ | ||
node_modules/ | ||
|
||
# local development files | ||
.logs/ | ||
*.log | ||
files/ | ||
|
||
# spam | ||
.DS_Store | ||
|
||
# git | ||
.git | ||
.gitignore | ||
|
||
# markdown | ||
LICENSE.md | ||
README.md | ||
|
||
# custom template | ||
custom-template.ejs | ||
|
||
# tailwind files | ||
tailwind.config.js | ||
public/styles/tailwind.css | ||
|
||
# installer | ||
docker-install.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Build stage | ||
FROM node:18-alpine | ||
|
||
# Label | ||
LABEL author="@ItzNotABug" | ||
|
||
# Set working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the rest of your application code | ||
COPY . . | ||
|
||
# Install PM2 globally | ||
RUN npm install pm2 -g | ||
|
||
# Install dependencies | ||
RUN npm ci --omit-dev | ||
|
||
# Start your app | ||
CMD ["pm2-runtime", "start", "app.js", "--name", "ghosler-app"] |
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 |
---|---|---|
|
@@ -25,4 +25,4 @@ | |
"track_links": true | ||
}, | ||
"mail": [] | ||
} | ||
} |
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,38 @@ | ||
#!/bin/bash | ||
|
||
# Define color codes | ||
NC='\033[0m' | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
BOLD_GREEN='\033[1;32m' | ||
|
||
# Set default values | ||
DEFAULT_PORT=2369 | ||
DEFAULT_CONTAINER_NAME="ghosler" | ||
|
||
echo "" | ||
echo -e "${BOLD_GREEN}Note: If you are UPDATING, use the same PORT & CONTAINER NAME!${NC}" | ||
echo "" | ||
|
||
# Prompt for port number with default | ||
echo -e "${GREEN}Provide a port for Ghosler [Default: $DEFAULT_PORT]${NC} : " | ||
read -r PORT | ||
PORT=${PORT:-$DEFAULT_PORT} | ||
|
||
# Prompt for container name with default | ||
echo -e "${GREEN}Provide a name for Ghosler Container [Default: $DEFAULT_CONTAINER_NAME]${NC} : " | ||
read -r CONTAINER_NAME | ||
CONTAINER_NAME=${CONTAINER_NAME:-$DEFAULT_CONTAINER_NAME} | ||
|
||
echo -e "${GREEN}Starting Ghosler Docker installation...${NC}" | ||
echo "" | ||
|
||
# Use the variables in the docker run command | ||
if ! docker run --rm --name "$CONTAINER_NAME" -d -p "$PORT":2369 -v "${CONTAINER_NAME}"-logs:/usr/src/app/.logs -v "${CONTAINER_NAME}"-analytics:/usr/src/app/files -v "${CONTAINER_NAME}"-configuration:/usr/src/app/configuration itznotabug/ghosler:0.94; then | ||
echo "" | ||
echo -e "${RED}Error: Failed to start Ghosler. Please check the Docker logs for more details.${NC}" >&2 | ||
exit 1 | ||
fi | ||
|
||
echo "" | ||
echo -e "${GREEN}Ghosler has been successfully installed and started.${NC}" |
Oops, something went wrong.