-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from CodeForPhilly/develop
Release: v0.1.10
- Loading branch information
Showing
6 changed files
with
125 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "third-places.fullname" . }}-frontend | ||
labels: | ||
{{- include "third-places.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: frontend | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "third-places.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: frontend | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "third-places.selectorLabels" . | nindent 8 }} | ||
app.kubernetes.io/component: frontend | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }}-frontend | ||
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: http | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "third-places.fullname" . }}-frontend | ||
labels: | ||
{{- include "third-places.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: frontend | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "third-places.selectorLabels" . | nindent 4 }} | ||
app.kubernetes.io/component: frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
FROM node:18-slim | ||
ARG HOME=usr/local/src/ | ||
WORKDIR $HOME | ||
## Target: environment | ||
# | ||
# This initially-empty target provides an environment for docker-compose | ||
# to start from the same base as the production builder environment. Common | ||
# dependencies could be added here | ||
# | ||
FROM node:18-slim as environment | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ADD . . | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD ["npm", "run", "dev", "--host"] | ||
EXPOSE 4321 | ||
## Target: builder | ||
# | ||
# This target builds /src/dist with layers optimized for caching dependencies | ||
# | ||
FROM environment as builder | ||
WORKDIR /src | ||
|
||
COPY package*.json ./ | ||
RUN npm ci | ||
|
||
COPY * ./ | ||
RUN npm run build | ||
|
||
|
||
## Target: runtime | ||
# | ||
# This target provides an nginx web server wrapped around the static | ||
# website build from the builder target | ||
# | ||
FROM nginx:alpine as runtime | ||
COPY --from=builder /src/dist /usr/share/nginx/html |