Skip to content

Commit 79066a4

Browse files
committed
Adding extra setup commands
1 parent 886132d commit 79066a4

File tree

9 files changed

+35
-6
lines changed

9 files changed

+35
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ dist
131131
.vscode/
132132
.DS_Store
133133
test/cypress/screenshots/*
134+
postgres_data/

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ To build from local directories, run:
1414
./build_local.sh
1515
```
1616

17+
Once built to run the containers:
18+
19+
```bash
20+
./up_local.sh
21+
```
22+
1723
### GitHub Build
1824

1925
To build from GitHub repositories, run:
@@ -22,6 +28,12 @@ To build from GitHub repositories, run:
2228
./build_github.sh
2329
```
2430

31+
Once built to run the containers:
32+
33+
```bash
34+
./up_github.sh
35+
```
36+
2537
Once the container is up and running, you can hit `http://localhost:8089/` it `/` will route you to FE react project by default.
2638

2739
`http://localhost:8089/backend/` will route you to the backend service.

build_github.sh

100644100755
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/bash
2-
3-
# Set environment variables for GitHub build
4-
export FRONTEND_BUILD_CONTEXT=https://${GH_TOKEN}@${FRONTEND_REPO_URL}#${FRONTEND_REF}
5-
export API_BUILD_CONTEXT=https://${GH_TOKEN}@${API_REPO_URL}#${API_REF}
6-
export BACKEND_BUILD_CONTEXT=https://${GH_TOKEN}@${BACKEND_REPO_URL}#${BACKEND_REF}
2+
source ./setup_github.sh
73

84
# Run Docker Compose
95
docker-compose -f compose.yaml up --build

build_local.sh

100644100755
File mode changed.

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ services:
3939
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
4040
- POSTGRES_DB=${POSTGRES_DB}
4141
volumes:
42-
- postgres_data:/var/lib/postgresql/data
42+
- ./postgres_data:/var/lib/postgresql/data
4343
healthcheck:
4444
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
4545
interval: 10s

setup_github.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Set environment variables for GitHub build
2+
export FRONTEND_BUILD_CONTEXT=https://${GH_TOKEN}@${FRONTEND_REPO_URL}#${FRONTEND_REF}
3+
export API_BUILD_CONTEXT=https://${GH_TOKEN}@${API_REPO_URL}#${API_REF}
4+
export BACKEND_BUILD_CONTEXT=https://${GH_TOKEN}@${BACKEND_REPO_URL}#${BACKEND_REF}

setup_local.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Set environment variables for local build
2+
export FRONTEND_BUILD_CONTEXT=./repo_refs/react1-app
3+
export API_BUILD_CONTEXT=./repo_refs/rails-app
4+
export BACKEND_BUILD_CONTEXT=./repo_refs/react2-app

up_github.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
source ./setup_github.sh
4+
5+
# Run Docker Compose
6+
docker-compose -f compose.yaml up

up_local.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
source ./setup_local.sh
4+
5+
# Run Docker Compose
6+
docker-compose -f compose.yaml up

0 commit comments

Comments
 (0)