-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Hello,
The frontend service uses beevelop/ionic as its base image. The issue is, that this base image size is 3.39 GB
, it comes with unnecessary dependencies such as Cordova and Android.
We can use a relatively much smaller base image, consisting of only node, for example, you can use node:14.15.5-alpine3.13
which has the size of roughly only 40 MB, and then install the ionic CLI dependency.
An example alternative Dockerfile would be
## Build
FROM node:14.15.5-alpine3.13 as build
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
RUN npm ci
RUN npm install -g @ionic/cli
# Bundle app source
COPY . .
RUN ionic build
## Run
FROM nginx:alpine
#COPY www /usr/share/nginx/html
COPY --from=build /usr/src/app/www /usr/share/nginx/html
MassaKone, elcharitas, ahmed0magdy, om-mob, Maerryham and 2 more
Metadata
Metadata
Assignees
Labels
No labels