Skip to content

Commit adb8b88

Browse files
committed
attempting to avoid the dockerfile and just use the docker compose
1 parent d27d508 commit adb8b88

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
submodules: false
4949

5050
- name: Build and start Docker Compose services
51-
run: docker-compose -f docker-compose.yaml up --build -d && cd test && npm install && npm run test:local
51+
run: bash ./setup_github.sh && echo "${FRONTEND_BUILD_CONTEXT}" && docker compose -f docker-compose.yaml up --build -d && cd test && npm run test:docker
5252

5353
- name: Recursively show cwd
5454
run: |

docker-compose.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
services:
22
frontend:
3-
build: ${FRONTEND_BUILD_CONTEXT}
3+
build:
4+
context: ${FRONTEND_BUILD_CONTEXT}
45
ports:
56
- 3000
67
networks:
@@ -11,7 +12,8 @@ services:
1112
volumes:
1213
- ./repo_refs/react1-app:/app
1314
api:
14-
build: ${API_BUILD_CONTEXT}
15+
build:
16+
context: ${API_BUILD_CONTEXT}
1517
ports:
1618
- 3000
1719
networks:
@@ -34,6 +36,8 @@ services:
3436
condition: service_healthy
3537
db:
3638
image: postgres
39+
build:
40+
context: ./postgres
3741
ports:
3842
- 5432
3943
networks:
@@ -50,7 +54,8 @@ services:
5054
timeout: 5s
5155
retries: 3
5256
backend:
53-
build: ${BACKEND_BUILD_CONTEXT}
57+
build:
58+
context: ${BACKEND_BUILD_CONTEXT}
5459
ports:
5560
- 3000
5661
environment:
@@ -62,6 +67,8 @@ services:
6267
- ./repo_refs/react2-app:/app
6368
nginx:
6469
image: nginx:alpine
70+
build:
71+
context: ./nginx
6572
ports:
6673
- 8089:80
6774
volumes:
@@ -74,7 +81,8 @@ services:
7481
- app-network
7582

7683
test:
77-
build: ./test
84+
build:
85+
context: ./test
7886
networks:
7987
- app-network
8088
volumes:
File renamed without changes.

setup_github.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Set environment variables for GitHub build
22
export FRONTEND_BUILD_CONTEXT=https://${GH_TOKEN}@${FRONTEND_REPO_URL}#${FRONTEND_REF}
33
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}
4+
export BACKEND_BUILD_CONTEXT=https://${GH_TOKEN}@${BACKEND_REPO_URL}#${BACKEND_REF}
5+
6+
echo "${FRONTEND_REPO_URL}#${FRONTEND_REF}"
7+
echo "${API_REPO_URL}#${API_REF}"
8+
echo "${BACKEND_REPO_URL}#${BACKEND_REF}"
9+
echo "${FRONTEND_BUILD_CONTEXT}"

0 commit comments

Comments
 (0)