Compare commits
No commits in common. "48a526f4041af13637b6540e8cfc0f4797008c94" and "6f336b18d359a4ff53eee012e4710a8b57fdd0cb" have entirely different histories.
48a526f404
...
6f336b18d3
2
.gitignore
vendored
2
.gitignore
vendored
@ -24,8 +24,6 @@ dist-ssr
|
|||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
# ENV
|
# ENV
|
||||||
docker/.env
|
|
||||||
!docker/.env.example
|
|
||||||
.env
|
.env
|
||||||
.env*
|
.env*
|
||||||
!.env.example
|
!.env.example
|
||||||
|
15
README.md
15
README.md
@ -34,14 +34,13 @@ Theo solved this by doing all of the work client side. Once you've went to https
|
|||||||
|
|
||||||
### How to self host
|
### How to self host
|
||||||
|
|
||||||
1. Clone the repo.
|
1. Clone the repo
|
||||||
2. Fill out the .env.example file in the root directory & rename it to .env.
|
2. Fill out the .env.example file & rename it to .env
|
||||||
3. Run `pnpm install && pnpm build` from the root of the repo.
|
3. Run `pnpm install` from the root of the repo
|
||||||
4. Navigate to the docker folder & fill out the .env.example file & rename it to .env.
|
4. Run `pnpm build` from the root of the repo
|
||||||
- *Note: Our docker compose assumes you plan to select an external network.*
|
5. Navigate to the docker folder & run `sudo docker-compose up -d`
|
||||||
5. Run `sudo docker compose up -d` from within the docker directory.
|
|
||||||
|
|
||||||
### How to update the website
|
### How to update the website
|
||||||
|
|
||||||
1. Run the bash script `update-bang` in the docker directory with the root directory of the project as the argument.
|
1. Run `pnpm build` from the root of the repo
|
||||||
- *Note: You can also simply run it from the root or docker directory without an argument.*
|
2. Navigate to the docker folder & run `sudo docker compose down && sudo docker-compose up -d`
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
PORT=5000
|
|
||||||
DOMAIN=bang.mydomain.com
|
|
||||||
NETWORK=bridge
|
|
@ -1,23 +1,23 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
bang-web-server:
|
bang-web-server:
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
build:
|
build:
|
||||||
context: ../
|
context: ../ # point to the parent directory where package.json and source code reside
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile # specific path to the Dockerfile
|
||||||
container_name: bang
|
container_name: bang
|
||||||
domainname: ${DOMAIN}
|
domainname: bang.gbrown.org
|
||||||
networks:
|
|
||||||
- ${NETWORK}
|
|
||||||
hostname: bang
|
hostname: bang
|
||||||
|
networks:
|
||||||
|
- node_apps
|
||||||
ports:
|
ports:
|
||||||
- ${PORT}:${PORT}
|
- "5000:5000"
|
||||||
tty: true
|
tty: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/app
|
- ../:/app # mount the parent directory to /app in the container
|
||||||
command: serve -s /app/dist -l 5000
|
command: serve -s /app/dist -l 5000
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
${NETWORK}:
|
node_apps:
|
||||||
external: true
|
external: true
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Function to check if we're in the correct directory
|
|
||||||
check_directory() {
|
|
||||||
if [ -d "docker" ] && [ -f "package.json" ]; then
|
|
||||||
return 0 # We're in the root directory
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Initialize root_dir
|
|
||||||
root_dir=""
|
|
||||||
|
|
||||||
# Check if argument is provided
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
# Use provided path
|
|
||||||
if [ -d "$1" ]; then
|
|
||||||
root_dir="$1"
|
|
||||||
cd "$root_dir" || exit 1
|
|
||||||
else
|
|
||||||
echo "Error: Provided directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# No argument provided, try to determine location
|
|
||||||
current_dir=$(basename "$(pwd)")
|
|
||||||
|
|
||||||
if [ "$current_dir" = "docker" ]; then
|
|
||||||
cd .. || exit 1
|
|
||||||
elif [ "$current_dir" != "Bang" ]; then
|
|
||||||
echo "Error: Not in the correct directory and no valid path provided"
|
|
||||||
echo "Please either:"
|
|
||||||
echo "1. Run this script from the Bang root directory"
|
|
||||||
echo "2. Run this script from the docker directory"
|
|
||||||
echo "3. Provide the path to the Bang root directory as an argument"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Verify we're in the correct directory
|
|
||||||
if ! check_directory; then
|
|
||||||
echo "Error: Not in the correct directory structure"
|
|
||||||
echo "Make sure you're in a directory with 'docker' folder and package.json"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
git pull
|
|
||||||
pnpm build
|
|
||||||
cd docker || exit 1
|
|
||||||
sudo docker compose down
|
|
||||||
sudo docker compose up -d
|
|
||||||
cd ..
|
|
Loading…
x
Reference in New Issue
Block a user