Skip to content

Commit

Permalink
add(CI/CD): back+front ends Dockerfile, k8s backend deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
thelissimus committed Dec 24, 2023
1 parent 8f7862f commit a6246c6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,12 @@ jobs:
- uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.backend
push: true
tags: thelissimus/hs-challenge:latest
tags: thelissimus/hs-challenge-backend:latest
- uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.frontend
push: true
tags: thelissimus/hs-challenge-frontend:latest
File renamed without changes.
14 changes: 14 additions & 0 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM theasp/clojurescript-nodejs:shadow-cljs-alpine AS build
WORKDIR /app
RUN apk --no-cache add leiningen
COPY project.clj shadow-cljs.edn /app/
RUN lein deps
COPY package.json package-lock.json /app/
RUN npm install
COPY . /app
RUN npm run build

FROM nginx:alpine
COPY --from=build /app/resources/public /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
37 changes: 37 additions & 0 deletions k8s/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: patients-backend
spec:
replicas: 1
selector:
matchLabels:
app: patients-backend
template:
metadata:
labels:
app: patients-backend
spec:
containers:
- name: patients-backend
image: thelissimus/hs-challenge-backend:latest
resources:
limits:
memory: "512Mi"
cpu: "500m"
ports:
- containerPort: 8080

---
apiVersion: v1
kind: Service
metadata:
name: patients-backend
spec:
type: NodePort
selector:
app: patients-backend
ports:
- port: 80
targetPort: 8080
nodePort: 30001

0 comments on commit a6246c6

Please sign in to comment.