Skip to content

Commit e00975a

Browse files
Merge pull request #28 from voltdatalab/caprover-yml
Update Instructions, Add Scripts
2 parents faae873 + 76551e5 commit e00975a

File tree

5 files changed

+78
-6
lines changed

5 files changed

+78
-6
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ A dynamic card manager built on top of Ghost CMS.
6060
. ./reset.sh
6161
```
6262
63+
**Note:** If you intend to build production images locally for the commands above, use `up-local.sh` and `setup-local.sh` instead of the other scripts, respectively.
64+
65+
### Installation with CapRover (One-Click App)
66+
67+
We have created a one-click app template which can be used in CapRover instances. You can use it by following these steps ([source](https://github.com/caprover/one-click-apps?tab=readme-ov-file#test-your-one-click-apps)):
68+
69+
- Login to your CapRover dashboard
70+
- Go to `apps` and click on `One-Click Apps/Databases`
71+
- Select `>> TEMPLATE <<` at the bottom of the dropdown list
72+
- Copy and paste the `xarta.yml` file from this repository, then click `Next`.
73+
- Provide the necessary variables and follow remaining instructions.
74+
6375
## Xarta Customization
6476
6577
- You may configure styling for classes `xarta-card`, `xarta-title`, `xarta-excerpt`, `xarta-updated-at`, `xarta-content`, `xarta-footer`, `xarta-custom-logo`, `xarta-default-logo` to further customize your card.

docker-compose.local.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# This docker-compose.local.yml file should override the docker-compose.yml file
3+
4+
services:
5+
next:
6+
# Force local build
7+
build:
8+
dockerfile: ./Dockerfile.next
9+
10+
setup-helper:
11+
# Force local build
12+
build:
13+
context: ./tools/setup

docker-compose.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ services:
2020
next:
2121
container_name: ${PROJECT_NAME}-next
2222
image: ghcr.io/voltdatalab/xarta
23-
# TODO: Add custom option to force local build
24-
# build:
25-
# dockerfile: ./Dockerfile.next
2623
environment:
2724
# TODO: Verify all env vars have been added
2825
# Required for get-settings
@@ -102,9 +99,6 @@ services:
10299
image: ghcr.io/voltdatalab/xarta-setup
103100
volumes:
104101
- setup_helper_data:/.setup-helper
105-
# TODO: Add custom option to force local build
106-
# build:
107-
# context: ./tools/setup
108102
environment:
109103
CADDY_CONTAINER_NAME: "${PROJECT_NAME}-caddy"
110104
PROJECT_NAME: ${PROJECT_NAME}

prod/setup-local.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Force the script to use project's root directory instead of the current working directory
6+
# See: https://stackoverflow.com/a/24114056
7+
scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
8+
echo "Script dir: ${scriptDir}"
9+
pushd $scriptDir/..
10+
11+
12+
# Configure sudo if required, verify docker is running
13+
. ./tools/scripts/utils.sh
14+
15+
# Source .env to get variables like $PROJECT_NAME
16+
source .env
17+
18+
echo "Initializing ${PROJECT_NAME}"
19+
20+
# TODO: Change this to production and dev
21+
$sudo_cmd docker compose -f docker-compose.yml -f docker-compose.local.yml up setup-helper ghost caddy -d --build
22+
23+
clear
24+
25+
$sudo_cmd docker attach ${PROJECT_NAME}-setup-helper
26+
27+
# Only remove the container, but not networks still in use
28+
$sudo_cmd docker compose stop setup-helper
29+
$sudo_cmd docker compose rm -f setup-helper
30+
31+
popd

prod/up-local.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Force the script to use project's root directory instead of the current working directory
6+
# See: https://stackoverflow.com/a/24114056
7+
scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
8+
echo "Script dir: ${scriptDir}/.."
9+
pushd $scriptDir/..
10+
11+
. ./tools/scripts/utils.sh
12+
13+
# Source .env to get variables like $PROJECT_NAME
14+
source .env
15+
16+
echo "Current directory: $(pwd)"
17+
echo "Initializing ${PROJECT_NAME}"
18+
19+
# Build and start containers
20+
$sudo_cmd docker compose -f docker-compose.yml -f docker-compose.local.yml up --build -d
21+
22+
popd

0 commit comments

Comments
 (0)