Skip to content

Commit

Permalink
Feature/client docker gha (#115)
Browse files Browse the repository at this point in the history
adding brian's dockerfile + gha file for client, updated gha file for dashboard
  • Loading branch information
tanfarming authored Jul 27, 2022
1 parent bc7b712 commit 982e6a6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/turkeydashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: turkeydashboard
on:
push:
branches:
paths-ignore: ["README.md"]
paths-ignore:
- "README.md"
- "client/**"
- '.github/workflows/turkeydashboardclient.yml'
workflow_dispatch:

jobs:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/turkeydashboardclient.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: turkeydashboardclient
on:
push:
branches:
paths:
- 'client/**'
- '.github/workflows/turkeydashboardclient.yml'
workflow_dispatch:

jobs:
turkeyGitops:
uses: mozilla/hubs-ops/.github/workflows/turkeyGitops.yml@master
with:
registry: mozilla
codePath: client
dockerfile: Dockerfile
DOCKER_HUB_USR: mzcshubs
secrets:
DOCKER_HUB_PWD: ${{ secrets.DOCKER_HUB_PWD_MOZ }}
23 changes: 23 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ---- build stage ----
FROM debian:bullseye-slim as builder
RUN apt-get update -y && apt-get install -y curl \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
workdir client
COPY . .
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install nodejs
RUN npm install -g yarn
RUN yarn && yarn run build

# ---- app stage ----
FROM debian:bullseye-slim
RUN apt-get update -y && apt-get install -y curl \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install nodejs
RUN npm install -g yarn
WORKDIR "/app"
RUN chown nobody /app
COPY --from=builder --chown=nobody:root /client ./
USER nobody
CMD yarn run start

0 comments on commit 982e6a6

Please sign in to comment.