Skip to content

Commit 07cbdc7

Browse files
committed
Updated to allow local development
1 parent 79066a4 commit 07cbdc7

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ 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-
```
17+
This setup allows for hot-swapping of code. Any changes made in the `repo_refs` directories will be immediately reflected in the running containers, allowing developers to see their changes in real-time via the nginx server.
2218

2319
### GitHub Build
2420

@@ -28,11 +24,9 @@ To build from GitHub repositories, run:
2824
./build_github.sh
2925
```
3026

31-
Once built to run the containers:
27+
The GitHub build process is isolated from the local development environment, ensuring a clean and isolated build environment. This prevents any potential conflicts with local volumes.
3228

33-
```bash
34-
./up_github.sh
35-
```
29+
## Once Built
3630

3731
Once the container is up and running, you can hit `http://localhost:8089/` it `/` will route you to FE react project by default.
3832

build_github.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22
source ./setup_github.sh
33

4-
# Run Docker Compose
5-
docker-compose -f compose.yaml up --build
4+
# Run Docker Compose without local volumes
5+
docker-compose -f compose.yaml up --build --no-deps

build_local.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/bin/bash
22

3-
# Set environment variables for local build
4-
export FRONTEND_BUILD_CONTEXT=./repo_refs/react1-app
5-
export API_BUILD_CONTEXT=./repo_refs/rails-app
6-
export BACKEND_BUILD_CONTEXT=./repo_refs/react2-app
3+
source ./setup_local.sh
74

85
# Run Docker Compose
96
docker-compose -f compose.yaml up --build

compose.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
environment:
99
- PUBLIC_URL=${FRONTEND_PUBLIC_URL}
1010
- WDS_SOCKET_PORT=${WDS_SOCKET_PORT}
11+
volumes:
12+
- ./repo_refs/react1-app:/app
1113
api:
1214
build: ${API_BUILD_CONTEXT}
1315
ports:
@@ -20,6 +22,8 @@ services:
2022
- DATABASE_HOST=${DATABASE_HOST}
2123
- DATABASE_USERNAME=${DATABASE_USERNAME}
2224
- RAILS_ENV=${RAILS_ENV}
25+
volumes:
26+
- ./repo_refs/rails-app:/app
2327
healthcheck:
2428
test: ["CMD", "curl", "-f", "http://localhost:3000/api/ping"]
2529
interval: 10s
@@ -54,6 +58,8 @@ services:
5458
- WDS_SOCKET_PORT=${WDS_SOCKET_PORT}
5559
networks:
5660
- app-network
61+
volumes:
62+
- ./repo_refs/react2-app:/app
5763
nginx:
5864
image: nginx:alpine
5965
ports:

0 commit comments

Comments
 (0)