Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile+k8s+update #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node
WORKDIR /app
COPY package*.json .

RUN npm install

ENV NEO4J_URI = "bolt://localhost:7687"
ENV NEO4J_USER = "neo4j"
ENV NEO4J_PASSWORD = "neo4j"
ENV GRAPHQL_LISTEN_PORT="3000"
EXPOSE 3000
COPY . .

RUN npm run build

CMD ["node", "build/index.js"]
36 changes: 36 additions & 0 deletions k8s/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: community-graphql
name: community-graphql
namespace: community-graphql
spec:
selector:
matchLabels:
app: community-graphql
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: community-graphql
spec:
containers:
- image: 715633473519.dkr.ecr.us-east-1.amazonaws.com/community-graphql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the image produced from the Dockerfile pushed up to AWS, right? Is there a sensible way to parameterize this to move towards a git action workflow for redeployment?

imagePullPolicy: Always
name: community-graphql
ports:
- containerPort: 3000
name: "graphql"
env:
- name: "NODE_ENV"
value: "production"
- name: "GRAPHQL_LISTEN_PORT"
value: "3000"
envFrom:
- secretRef:
name: community-graphql-secrets
12 changes: 12 additions & 0 deletions k8s/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: community-graphql
secretGenerator:
- name: community-graphql-secrets
envs:
- .env

resources:
- deployment.yaml
- service.yaml
15 changes: 15 additions & 0 deletions k8s/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: community-graphql
name: community-graphql
spec:
type: LoadBalancer
selector:
app: community-graphql
ports:
- name: "3000"
port: 3000
protocol: TCP
targetPort: 3000
Loading