Skip to content

Commit bb892bd

Browse files
committed
Using docker extension to control volume usage
1 parent a37d147 commit bb892bd

File tree

8 files changed

+41
-24
lines changed

8 files changed

+41
-24
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,16 @@ jobs:
4040
container:
4141
image: node:18
4242
steps:
43-
- uses: KengoTODA/actions-setup-docker-compose@v1
44-
with:
45-
version: "2.14.2"
46-
4743
- name: Checkout code
4844
uses: actions/checkout@v2
4945
with:
5046
submodules: false
5147

5248
- name: Build and start Docker Compose services then run tests
5349
run: |
54-
bash ./setup_github.sh &&
50+
./setup_github.sh &&
5551
docker-compose --profile baseServices up --build --no-deps -d &&
56-
cd test && npm install && npx cypress run
52+
cd test && npm install && npx cypress run; docker ps
5753
5854
# - name: check dns is working
5955
# run: cat /etc/hosts; netstat -tulpn # Use -tulpn to show TCP/UDP listeners

build_github.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
./setup_github.sh
33

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

build_local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source ./setup_local.sh
33

44
# Run Docker Compose
5-
docker-compose up --build -d
5+
docker-compose --profile baseServices -f docker-compose.local.yaml up --build -d

docker-compose.local.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
services:
2+
frontend:
3+
extends:
4+
file: docker-compose.yaml
5+
service: frontend
6+
volumes:
7+
- ./repo_refs/react1-app:/app
8+
backend:
9+
extends:
10+
file: docker-compose.yaml
11+
service: backend
12+
volumes:
13+
- ./repo_refs/react2-app:/app
14+
15+
api:
16+
extends:
17+
file: docker-compose.yaml
18+
service: api
19+
volumes:
20+
- ./repo_refs/rails-app:/app
21+
db:
22+
extends:
23+
file: docker-compose.yaml
24+
service: db
25+
volumes:
26+
- ./postgres_data:/var/lib/postgresql/data
27+
28+
volumes:
29+
postgres_data:
30+
31+
networks:
32+
app-network:
33+
driver: bridge

docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- PUBLIC_URL=${FRONTEND_PUBLIC_URL}
1111
- WDS_SOCKET_PORT=${WDS_SOCKET_PORT}
1212
volumes:
13-
- ./repo_refs/react1-app:.
13+
- ./repo_refs/react1-app:/app
1414
api:
1515
profiles: ["baseServices", "full"]
1616
build: ${API_BUILD_CONTEXT}
@@ -25,7 +25,7 @@ services:
2525
- DATABASE_USERNAME=${DATABASE_USERNAME}
2626
- RAILS_ENV=${RAILS_ENV}
2727
volumes:
28-
- ./repo_refs/rails-app:.
28+
- ./repo_refs/rails-app:/app
2929
healthcheck:
3030
test: ["CMD", "curl", "-f", "http://localhost:3000/api/ping"]
3131
interval: 10s
@@ -63,7 +63,7 @@ services:
6363
networks:
6464
- app-network
6565
volumes:
66-
- ./repo_refs/react2-app:.
66+
- ./repo_refs/react2-app:/app
6767
nginx:
6868
profiles: ["baseServices", "full"]
6969
image: nginx:alpine
@@ -89,7 +89,7 @@ services:
8989
networks:
9090
- app-network
9191
volumes:
92-
- ./test:.
92+
- ./test:/app
9393
environment:
9494
- CYPRESS_BASE_URL=http://nginx:80
9595
depends_on:

setup_github.sh

100644100755
File mode changed.

up_github.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

up_local.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)