Skip to content

Commit

Permalink
chore: test prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck committed Apr 13, 2024
1 parent 60aa411 commit 6e7ce52
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/on_push_branch_execute_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn test:ci

Expand All @@ -34,7 +34,19 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn lint

yarn_build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn build:prod
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.12-bookworm as base
FROM node:18-bookworm as base

USER node
WORKDIR /home/node/app
Expand All @@ -24,22 +24,18 @@ RUN yarn install

FROM base as production_builder

USER node
USER root

# Copy project files into the docker image
COPY --chown=node:node . ./

# Install app dependencies
COPY package.json /a
COPY --chown=node:node package.json yarn.lock ./
RUN yarn install
# Copy project files into the docker image
COPY . ./
RUN yarn build:prod

FROM nginx:alpine as production

## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
FROM nginxinc/nginx-unprivileged:stable-alpine AS production

## From 'builder' copy website to default nginx public folder
COPY --from=production_builder /home/node/app/www /usr/share/nginx/html
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
3 changes: 2 additions & 1 deletion src/app/pages/animator/animator.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ComponentsModule } from '@components/components.module';
import { AnimatorPage } from './animator.page';
Expand Down Expand Up @@ -66,6 +66,7 @@ const MODALS = [
}
])
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [...GUARDS],
declarations: [...COMPONENTS, ...MODALS, AnimatorPage],
exports: [...COMPONENTS]
Expand Down

0 comments on commit 6e7ce52

Please sign in to comment.