Skip to content

Commit

Permalink
build in context of workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherJMiller committed Dec 16, 2023
1 parent f0a903a commit 3f99aba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@eafaea8d0f5853934deece2ffa67af59d936562b
with:
context: ./${{ matrix.service }}
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
file: ./${{ matrix.service }}/Dockerfile
Expand Down
8 changes: 3 additions & 5 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ FROM node:current as builder

WORKDIR /build

# Add Web Files
# Add Files
ADD . .
ADD package.json .
ADD yarn.lock .

# Build
RUN yarn install && yarn build
RUN yarn install && yarn workspace api build

FROM node:current

WORKDIR /app

COPY --from=builder /build/dist /app
COPY --from=builder /build/api/dist /app

CMD [ "node", "main.js" ]
10 changes: 4 additions & 6 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
FROM node:current as web_builder
FROM node:current as builder

WORKDIR /build

# Add Web Files
# Add Files
ADD . .
ADD package.json .
ADD yarn.lock .

# Build
RUN yarn install && yarn build
RUN yarn install && yarn workspace frontend build

FROM docker.io/nginx:1-alpine

COPY --from=web_builder /build/dist /usr/share/nginx/html
COPY --from=builder /build/frontend/dist /usr/share/nginx/html
ADD nginx.conf /etc/nginx/nginx.conf

0 comments on commit 3f99aba

Please sign in to comment.