Recipe:
-
Dockerfile Configuration:
FROM node:14 WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN au build --env prod CMD ["npm", "start"]
-
Build and Run:
docker build -t your-app-name . docker run -p 8080:8080 your-app-name
{% hint style="info" %} Ensure the Dockerfile copies all necessary files and sets the correct working directory. {% endhint %}
Issue: Uninstalling a package without updating aurelia.json
can lead to build errors.
Solution:
-
Uninstall the Package:
npm uninstall <package-name> --save
-
Remove from
aurelia.json
:- Delete any references in the
dependencies
array. - Update
copyFiles
if assets were previously copied.
- Delete any references in the
{% hint style="info" %} Always verify dependency configurations after uninstalling packages. {% endhint %}
Issue: Team Foundation Server (TFS) builds may fail due to environment discrepancies.
Solution:
-
Ensure Node.js and NPM are Installed:
- Configure build agents with necessary tools.
-
Install Dependencies During Build:
- Add
npm install
as a build step before running build commands.
- Add
-
Run Build Commands:
au build --env prod
{% hint style="info" %} Use TFS build pipelines to automate these steps for consistency. {% endhint %}
{% hint style="info" %} For more detailed configurations and advanced usage, refer to the Aurelia CLI GitHub Repository. {% endhint %}