Skip to content

Commit

Permalink
Cleanup Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bperel committed Nov 20, 2023
1 parent a2b3e90 commit 5ff9ff3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy-dumili.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
file: apps/dumili/Dockerfile
platforms: linux/x86_64
push: true
target: dumili
target: web
cache-from: type=registry,ref=ghcr.io/bperel/dumili-app:buildcache
cache-to: type=registry,ref=ghcr.io/bperel/dumili-app:buildcache,mode=max
tags: |
Expand All @@ -70,11 +70,10 @@ jobs:
- name: Build and push api
uses: docker/build-push-action@v5
with:
context: .
file: apps/dumili/Dockerfile
platforms: linux/x86_64
push: true
target: dumili-api
target: api
cache-from: type=registry,ref=ghcr.io/bperel/dumili-api:buildcache
cache-to: type=registry,ref=ghcr.io/bperel/dumili-api:buildcache,mode=max
tags: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
path = apps/duck-estimator
url = [email protected]:bperel/duck-estimator.git
branch=master
[submodule "apps/duckguessr"]
path = apps/duckguessr
url = [email protected]:bperel/duckguessr.git
2 changes: 1 addition & 1 deletion apps/dumili
12 changes: 4 additions & 8 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM pnpm AS build

WORKDIR /app
COPY . ./
RUN --mount=type=cache,id=pnpm-store,target=/app/.pnpm-store \
RUN --mount=type=cache,id=pnpm-store-web,target=/app/.pnpm-store \
pnpm -r -F ~web... -F ~api... i

RUN pnpm -r -F ~web... -F ~api... run build
Expand All @@ -24,21 +24,17 @@ FROM pnpm AS api
LABEL org.opencontainers.image.authors="Bruno Perel"

WORKDIR /app

COPY {package.json,pnpm-*.yaml}.yaml ./
COPY --from=build /app/packages/api/dist/api ./
COPY --from=build /app/packages/prisma-clients ./packages/prisma-clients
COPY --from=build /app/packages/types ./packages/types
COPY --from=build /app/packages/prisma-clients/dist/ ./packages/prisma-clients
COPY --from=build /app/packages/types/dist/ ./packages/types

WORKDIR /app/packages/api
COPY --from=build /app/packages/api/dist/api ./

COPY packages/api/package.json ./
COPY packages/api/translations ./translations

RUN --mount=type=cache,id=pnpm-store,target=/app/.pnpm-store \
pnpm i --production
RUN --mount=type=cache,id=pnpm-store-web,target=/app/.pnpm-store \
pnpm -r -F ~api... -F !~dm-types i --production

COPY ./packages/api/routes/demo/*.csv ./routes/demo/
COPY ./packages/api/emails ./emails/
Expand Down
3 changes: 2 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"vue-router": "^4.2.5",
"vue-slicksort": "^2.0.5",
"~api-routes": "workspace:*",
"~axios-helper": "workspace:*"
"~axios-helper": "workspace:*",
"~dm-types": "workspace:*"
},
"devDependencies": {
"@antfu/eslint-config": "^1.2.1",
Expand Down
3 changes: 3 additions & 0 deletions apps/web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5ff9ff3

Please sign in to comment.