-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding OS deployment artifacts and Dockerfile for frontend
- Loading branch information
Showing
10 changed files
with
289 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Stage 1: Build the application | ||
FROM node:lts-alpine AS builder | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm ci | ||
|
||
# Copy the rest of the application code to the working directory | ||
COPY . . | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
# Stage 2: Serve the application | ||
FROM node:lts-alpine | ||
|
||
# Install http-server globally to serve static files | ||
RUN npm install -g http-server | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy the built files from the previous stage | ||
COPY --from=builder /app/dist ./dist | ||
|
||
# Copy index.html to 404 to fix client side routing | ||
COPY --from=builder /app/dist/index.html ./dist/404.html | ||
|
||
# Expose port 5173 to the outside world | ||
EXPOSE 5173 | ||
|
||
# Command to run http-server to serve the built files | ||
CMD ["http-server", "dist", "-p", "5173", "--history-api-fallback"] |
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
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,169 @@ | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
metadata: | ||
creationTimestamp: null | ||
name: medis-data-template | ||
labels: | ||
template: medis-data-template | ||
objects: | ||
- apiVersion: v1 | ||
kind: ImageStream | ||
metadata: | ||
annotations: | ||
name: ${NAME} | ||
app.openshift.io/vcs-ref: ${SOURCE_REPOSITORY_REF} | ||
app.openshift.io/vcs-uri: ${SOURCE_REPOSITORY_URL} | ||
name: ${NAME}-backend | ||
creationTimestamp: null | ||
namespace: ${NAMESPACE} | ||
labels: | ||
shared: true | ||
app: ${NAME} | ||
app.kubernetes.io/component: ${NAME} | ||
app.kubernetes.io/instance: ${NAME} | ||
app.kubernetes.io/name: ${NAME} | ||
app.openshift.io/runtime: nodejs | ||
app.openshift.io/runtime-version: ${NODE_JS_VERSION} | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
- apiVersion: v1 | ||
kind: ImageStream | ||
metadata: | ||
annotations: | ||
name: ${NAME} | ||
app.openshift.io/vcs-ref: ${SOURCE_REPOSITORY_REF} | ||
app.openshift.io/vcs-uri: ${SOURCE_REPOSITORY_URL} | ||
name: ${NAME}-frontend | ||
creationTimestamp: null | ||
namespace: ${NAMESPACE} | ||
labels: | ||
shared: true | ||
app: ${NAME} | ||
app.kubernetes.io/component: ${NAME} | ||
app.kubernetes.io/instance: ${NAME} | ||
app.kubernetes.io/name: ${NAME} | ||
app.openshift.io/runtime: nodejs | ||
app.openshift.io/runtime-version: ${NODE_JS_VERSION} | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
- apiVersion: v1 | ||
kind: BuildConfig | ||
metadata: | ||
annotations: | ||
name: ${NAME} | ||
app.openshift.io/vcs-ref: ${SOURCE_REPOSITORY_REF} | ||
app.openshift.io/vcs-uri: ${SOURCE_REPOSITORY_URL} | ||
name: ${NAME}-backend | ||
creationTimestamp: null | ||
namespace: ${NAMESPACE} | ||
labels: | ||
app: ${NAME} | ||
app.openshift.io/runtime: nodejs | ||
spec: | ||
nodeSelector: null | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: ${NAME}-backend:${TAG} | ||
successfulBuildsHistoryLimit: 5 | ||
failedBuildsHistoryLimit: 5 | ||
strategy: | ||
type: Docker | ||
dockerStrategy: | ||
dockerfilePath: Dockerfile | ||
postCommit: {} | ||
resources: | ||
requests: | ||
cpu: 500Mi | ||
memory: 500Mi | ||
limits: | ||
cpu: 1 | ||
memory: 1Gi | ||
source: | ||
type: Git | ||
git: | ||
uri: ${SOURCE_REPOSITORY_URL} | ||
ref: ${SOURCE_REPOSITORY_REF} | ||
contextDir: /server | ||
triggers: | ||
- type: ConfigChange | ||
- imageChange: {} | ||
type: ImageChange | ||
runPolicy: Serial | ||
- apiVersion: v1 | ||
kind: BuildConfig | ||
metadata: | ||
annotations: | ||
name: ${NAME} | ||
app.openshift.io/vcs-ref: ${SOURCE_REPOSITORY_REF} | ||
app.openshift.io/vcs-uri: ${SOURCE_REPOSITORY_URL} | ||
name: ${NAME}-frontend | ||
creationTimestamp: null | ||
namespace: ${NAMESPACE} | ||
labels: | ||
app: ${NAME} | ||
app.openshift.io/runtime: nodejs | ||
spec: | ||
nodeSelector: null | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: ${NAME}-frontend:${TAG} | ||
successfulBuildsHistoryLimit: 5 | ||
failedBuildsHistoryLimit: 5 | ||
strategy: | ||
type: Docker | ||
dockerStrategy: | ||
dockerfilePath: Dockerfile | ||
postCommit: {} | ||
resources: | ||
requests: | ||
cpu: 500Mi | ||
memory: 500Mi | ||
limits: | ||
cpu: 1 | ||
memory: 1Gi | ||
source: | ||
type: Git | ||
git: | ||
uri: ${SOURCE_REPOSITORY_URL} | ||
ref: ${SOURCE_REPOSITORY_REF} | ||
contextDir: /client | ||
triggers: | ||
- type: ConfigChange | ||
- imageChange: {} | ||
type: ImageChange | ||
runPolicy: Serial | ||
parameters: | ||
- description: A name used for all objects | ||
displayName: Name | ||
name: NAME | ||
required: true | ||
value: medis-data-template | ||
- description: The namespace of the project namespace | ||
displayName: Namespace | ||
name: NAMESPACE | ||
required: true | ||
value: "" | ||
- description: Tag used for the image tags | ||
displayName: tag | ||
name: TAG | ||
required: true | ||
value: latest | ||
- description: SOURCE_REPOSITORY_URL | ||
displayName: SOURCE_REPOSITORY_URL | ||
name: SOURCE_REPOSITORY_URL | ||
required: true | ||
value: "https://github.com/bcgov/medis-data-template-generator" | ||
- description: SOURCE_REPOSITORY_REF | ||
displayName: SOURCE_REPOSITORY_REF | ||
name: SOURCE_REPOSITORY_REF | ||
required: true | ||
value: dev | ||
- description: NODE_JS_VERSION | ||
displayName: NODE_JS_VERSION | ||
name: NODE_JS_VERSION | ||
required: true | ||
value: "20" |
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,13 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: medis-data-template-frontend | ||
data: | ||
VITE_KEYCLOAK_URL: | ||
VITE_KEYCLOAK_REALM: | ||
VITE_KEYCLOAK_CLIENT_ID: | ||
VITE_SSO_REDIRECT_URI: | ||
VITE_BASE_PATH: | ||
VITE_ENVIRONMENT: | ||
VITE_API_URL: | ||
NODE_ENV: |
Empty file.
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,38 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: | ||
type: Opaque | ||
stringData: | ||
RLS_API_URL: | ||
RLS_HA_FORM_ID: | ||
RLS_ROLE_FORM_ID: | ||
RLS_API_KEY: | ||
TEMPLATE_ROUTE: | ||
CHEFS_API_URL: | ||
CHEFS_FISCAL_YEAR_REPORTING_DATES_FORM_ID: | ||
CHEFS_FISCAL_YEAR_REPORTING_DATES_API_KEY: | ||
CHEFS_PCN_BUDGET_FORM_ID: | ||
CHEFS_PCN_BUDGET_API_KEY: | ||
CHEFS_CHC_BUDGET_FORM_ID: | ||
CHEFS_CHC_BUDGET_API_KEY: | ||
CHEFS_UPCC_BUDGET_FORM_ID: | ||
CHEFS_UPCC_BUDGET_API_KEY: | ||
CHEFS_NPPCC_BUDGET_FORM_ID: | ||
CHEFS_NPPCC_BUDGET_API_KEY: | ||
CHEFS_PCN_FINANCIAL_FORM_ID: | ||
CHEFS_PCN_FINANCIAL_API_KEY: | ||
CHEFS_CHC_FINANCIAL_FORM_ID: | ||
CHEFS_CHC_FINANCIAL_API_KEY: | ||
CHEFS_UPCC_FINANCIAL_FORM_ID: | ||
CHEFS_UPCC_FINANCIAL_API_KEY: | ||
CHEFS_NPPCC_FINANCIAL_FORM_ID: | ||
CHEFS_NPPCC_FINANCIAL_API_KEY: | ||
MINIO_ENDPOINT: | ||
MINIO_ACCESS_KEY: | ||
MINIO_SECRET_KEY: | ||
MINIO_BUCKET: | ||
MINIO_REGION: | ||
ENVIRONMENT: | ||
PORT: | ||
JWKS_URI: |
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