Skip to content

Instantly share code, notes, and snippets.

@wizardnet972
Created October 20, 2024 13:17
Show Gist options
  • Save wizardnet972/9a3cb914a9ab589cc33aab0ded268669 to your computer and use it in GitHub Desktop.
Save wizardnet972/9a3cb914a9ab589cc33aab0ded268669 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Define the repository name
repo="pontera"
rm -rf $repo
npx --yes create-nx-workspace@19 $repo --preset angular-monorepo --appName ${repo}-ui --bundler esbuild --style scss --ssr false --e2eTestRunner playwright --ci skip --pm yarn
cd $repo
yarn add [email protected]
# yarn add ngxtension
yarn nx g @nx/angular:lib --name ng-lib --directory libs/ng-lib --buildable
yarn nx generate @nx/angular:storybook-configuration --project=${repo}-ui --no-interactive
yarn nx run-many -t build,lint,test
# Create a Dockerfile
cat <<EOF >Dockerfile
FROM node:20.18.0-bullseye-slim
# RUN apk update && apk add git g++ make py3-pip curl
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY yarn.lock package.json ./
RUN yarn --frozen-lockfile --verbose
COPY . .
RUN yarn nx run-many -t build,lint,test
EOF
# Create a Dockerfile
cat <<EOF >.dockerignore
node_modules
dist
.angular
.nx
EOF
docker build --progress=plain --no-cache -t $repo .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment