Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a smaller base image for the frontend service #55

Open
nooreldeensalah opened this issue Sep 10, 2022 · 0 comments · May be fixed by #56
Open

Using a smaller base image for the frontend service #55

nooreldeensalah opened this issue Sep 10, 2022 · 0 comments · May be fixed by #56

Comments

@nooreldeensalah
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant