Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update Docker configuration for backend and frontend #2

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Build docker containers
uses: docker/bake-action@v3
with:
load: true

- name: Backend test
run: docker compose run backend-test

- name: Frontend test
run: docker compose run frontend-test
run: docker compose run frontend-test

- name: Cleanup
if: always()
run: docker compose down
6 changes: 4 additions & 2 deletions Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ ENV NODE_ENV development

WORKDIR /app

COPY . .
COPY package.json package-lock.json ./

RUN npm install

COPY . .

CMD [ "npm", "run", "dev" ]

EXPOSE 5000
EXPOSE 3000
6 changes: 4 additions & 2 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ ENV NODE_ENV development

WORKDIR /app

COPY . .
COPY package.json package-lock.json ./

RUN npm install \
&& npm i -g jest \
&& npx playwright install --with-deps chromium

COPY . .

CMD [ "yarn", "start" ]

EXPOSE 5000
EXPOSE 3000
16 changes: 16 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
target "backend" {
cache-to = [
"type=gha,ignore-error=true,mode=max,scope=backend"
]
cache-from = [
"type=gha,scope=backend"
]
}
target "frontend" {
cache-to = [
"type=gha,ignore-error=true,mode=max,scope=frontend"
]
cache-from = [
"type=gha,scope=frontend"
]
}
Loading