Skip to content

Commit

Permalink
chore: Update Docker configuration for backend and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
shestera committed Jul 5, 2024
1 parent 701843c commit edf96fe
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
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"
]
}

0 comments on commit edf96fe

Please sign in to comment.