-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix docker compose script and ci/cd (#46)
* Fix docker compose script and ci/cd
- Loading branch information
1 parent
5016c20
commit e2f5863
Showing
28 changed files
with
185 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: "3.9" | ||
|
||
services: | ||
|
||
consumer: | ||
environment: | ||
- INTERNAL_BACKEND_URL=${INTERNAL_BACKEND_URL:-http://provider:8000} | ||
- NEXT_PUBLIC_PROJECT_URL=${NEXT_PUBLIC_PROJECT_URL:-https://localhost:8443} | ||
- REACT_ENVIRONMENT=${REACT_ENVIRONMENT:-development} | ||
healthcheck: | ||
test: wget -O- -q http://localhost:3000/api/health/ || exit 1 | ||
|
||
provider: | ||
command: -p 8000 -d pacts -o --insecure-tls | ||
entrypoint: ./pact_stub_server.sh | ||
healthcheck: | ||
test: wget -O- -q http://localhost:8000/api/health/ || exit 1 | ||
image: pactfoundation/pact-stub-server | ||
profiles: | ||
- pact | ||
volumes: | ||
- ./scripts/pact_stub_server.sh:/app/pact_stub_server.sh | ||
- ./pacts:/app/pacts:ro | ||
working_dir: /app | ||
|
||
proxy: | ||
depends_on: | ||
consumer: | ||
condition: service_healthy | ||
provider: | ||
condition: service_healthy | ||
extends: | ||
file: ./docker-compose/common.yaml | ||
service: proxy | ||
profiles: | ||
- pact | ||
|
||
proxy-no-pact: | ||
depends_on: | ||
consumer: | ||
condition: service_healthy | ||
extends: | ||
file: ./docker-compose/common.yaml | ||
service: proxy | ||
profiles: | ||
- no-pact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
{{cookiecutter.project_dirname}}/docker-compose/consumer-image.yaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
{{cookiecutter.project_dirname}}/docker-compose/consumer.yaml
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
{{cookiecutter.project_dirname}}/docker-compose/e2e-branch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: "3.9" | ||
|
||
services: | ||
|
||
consumer: | ||
build: | ||
context: ./ | ||
dockerfile: ${SERVICE_DOCKER_FILE:-docker/remote.Dockerfile} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "3.9" | ||
|
||
services: | ||
|
||
consumer: | ||
image: ${CONSUMER_IMAGE} | ||
|
||
cypress: | ||
depends_on: | ||
- proxy | ||
extends: | ||
file: ./docker-compose/common.yaml | ||
service: cypress | ||
profiles: | ||
- pact | ||
|
||
cypress-no-pact: | ||
depends_on: | ||
- proxy-no-pact | ||
extends: | ||
file: ./docker-compose/common.yaml | ||
service: cypress | ||
profiles: | ||
- no-pact |
10 changes: 10 additions & 0 deletions
10
{{cookiecutter.project_dirname}}/docker-compose/local.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3.9" | ||
|
||
services: | ||
|
||
consumer: | ||
build: | ||
context: ./ | ||
dockerfile: ${SERVICE_DOCKER_FILE:-docker/local.Dockerfile} | ||
volumes: | ||
- ./:/app |
19 changes: 0 additions & 19 deletions
19
{{cookiecutter.project_dirname}}/docker-compose/provider.yaml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:16-bullseye-slim | ||
LABEL company="20tab" project="{{ cookiecutter.project_slug }}" service="frontend" stage="test" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG USER=appuser | ||
ENV APPUSER=$USER LANG=C.UTF-8 LC_ALL=C.UTF-8 NEXT_TELEMETRY_DISABLED=1 NODE_ENV="development" TZ='Europe/Rome' WORKDIR=/app | ||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 NEXT_TELEMETRY_DISABLED=1 NODE_ENV="development" TZ='Europe/Rome' WORKDIR=/app | ||
RUN apt-get update \ | ||
&& apt-get install --assume-yes --no-install-recommends \ | ||
g++ \ | ||
make \ | ||
python3 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
WORKDIR $WORKDIR | ||
RUN addgroup --system --gid 997 $APPUSER | ||
RUN adduser --system --uid 997 $APPUSER | ||
USER $APPUSER | ||
ENV PATH="$PATH:./node_modules/.bin" | ||
COPY --chown=$APPUSER package.json yarn.lock ./ | ||
COPY package.json yarn.lock ./ | ||
ENTRYPOINT ["./scripts/test.sh"] | ||
CMD yarn ci:unit-test && yarn ci:contract-test | ||
LABEL company="20tab" project="{{ cookiecutter.project_slug }}" service="frontend" stage="test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.