Fronted (Angular) image from the example of MEAN stack
1.2K
Frontend for application using Angular (updated to 12.1.2)
Run npm start for a dev server. It will open http://localhost:4200/ in your default browser. The app will automatically reload if you change any of the source files.
Or you can run npm run dev-server. It will start frontend and api together. Open http://localhost:4200/ to access application.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build. Also, we have enabled SSR (Server side rendering) for fast first loading of UI on production.
# Create image based off of the official Node 10 image
FROM node:14.5-alpine as builder
# Copy dependency definitions
COPY package.json package-lock.json ./
# disabling ssl for npm for Dev or if you are behind proxy
RUN npm set strict-ssl false
## installing and Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm ci && mkdir /app && mv ./node_modules ./app
# Change directory so that our commands run inside this new directory
WORKDIR /app
# Get all the code needed to run the app
COPY . /app/
# Build server side bundles
RUN npm run build:ssr
FROM node:14.5-alpine
## From 'builder' copy published folder
COPY --from=builder /app/dist/frontend /app
WORKDIR /app
# Expose the port the app runs in
EXPOSE 4000
CMD ["node", "server/main.js"]
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
Content type
Image
Digest
sha256:244a027ee…
Size
25.5 MB
Last updated
about 1 month ago
docker pull nitin27may/mean-angular