Skip to content

Commit 6b3ebf0

Browse files
committed
export trying to fix mounting nginx conf.d issues
1 parent dcb5582 commit 6b3ebf0

File tree

6 files changed

+34
-16
lines changed

6 files changed

+34
-16
lines changed

.circleci/config.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ jobs:
1212
docker_layer_caching: true
1313
- run: ls -l $(ls)
1414
- run: bash ./build_github.sh
15-
- cypress/install:
16-
package-manager: npm
17-
working-directory: test
18-
- cypress/run-tests:
19-
cypress-command: npx wait-on@latest http://localhost:8089 && cd test && npx cypress run
20-
working-directory: test
15+
- run: docker ps --format "table {{.Names}}\t{{.Ports}}" && docker compose ps
16+
- run: docker-compose up --build --no-deps -d test
17+
- run: docker compose exec test npx cypress run
18+
2119
workflows:
2220
use-my-orb:
2321
jobs:

build_github.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,13 @@ fi
1212

1313
source .env
1414

15+
16+
# Create temporary container to copy nginx config
17+
docker volume create project_nginx_conf
18+
docker container create --name nginx_tmp -v project_nginx_conf:/etc/nginx/conf.d alpine
19+
docker cp nginx/default.conf nginx_tmp:/etc/nginx/conf.d/
20+
docker compose exec nginx nginx -s reload
21+
docker rm nginx_tmp
22+
1523
# Run Docker Compose without local volumes
16-
docker-compose up --build --no-deps -d
24+
docker-compose --profile core 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 -f docker-compose.local.yaml up --build
5+
docker-compose --profile core -f docker-compose.local.yaml up --build -d

docker-compose.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
services:
22
frontend:
33
build: ${FRONTEND_BUILD_CONTEXT}
4+
profiles: ["core", "test"]
45
ports:
56
- 3000
67
networks:
@@ -10,6 +11,7 @@ services:
1011
- WDS_SOCKET_PORT=${WDS_SOCKET_PORT}
1112
api:
1213
build: ${API_BUILD_CONTEXT}
14+
profiles: ["core", "test"]
1315
ports:
1416
- 3000
1517
networks:
@@ -30,6 +32,7 @@ services:
3032
condition: service_healthy
3133
db:
3234
image: postgres
35+
profiles: ["core", "test"]
3336
ports:
3437
- 5432
3538
networks:
@@ -47,6 +50,7 @@ services:
4750
retries: 3
4851
backend:
4952
build: ${BACKEND_BUILD_CONTEXT}
53+
profiles: ["core", "test"]
5054
ports:
5155
- 3000
5256
environment:
@@ -56,10 +60,11 @@ services:
5660
- app-network
5761
nginx:
5862
image: nginx:alpine
63+
profiles: ["core", "test"]
5964
ports:
6065
- 8089:80
6166
volumes:
62-
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
67+
- nginx_conf:/etc/nginx/conf.d
6368
depends_on:
6469
- api
6570
- frontend
@@ -71,10 +76,24 @@ services:
7176
interval: 10s
7277
timeout: 5s
7378
retries: 3
79+
test:
80+
build: ./test
81+
profiles: ["test"]
82+
environment:
83+
- CYPRESS_BASE_URL=http://nginx:80
84+
networks:
85+
- app-network
86+
depends_on:
87+
- frontend
88+
- backend
89+
- api
90+
- db
91+
- nginx
7492

7593
networks:
7694
app-network:
7795
driver: bridge
7896

7997
volumes:
8098
postgres_data:
99+
nginx_conf:

nginx/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM ghcr.io/perfetti/react1-app:latest as react-app
22

33
FROM nginx:alpine
4-
COPY --from=react-app /usr/share/nginx/html /react-app
54
COPY default.conf /etc/nginx/conf.d/default.conf

up_github.sh

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

0 commit comments

Comments
 (0)