Sign inSign up

steelburn/ionic

By steelburn

Updated over 4 years ago

This is an Ionic Docker image built based on Linux. It strives to be as small as possible.

Image
1

1.2K

steelburn/ionic repository overview

alpineIonic

docker pull steelburn/ionic

Introduction

This is an Ionic docker image built based on Alpine Linux. It strives to be as small as possible. In recent image, I've changed the webserver from built-in HTTP server to Lighttpd.

Exposed ports

Port NumberPurpose
80HTTP port
8100Ionic HTTP serving port (SERVE=true)
35729Live reload port (deprecated)
8080HTTP serving port with PWA (PWE=true)

How to use this container image?

Command line:

sudo docker run -ti -p <yourport>:80 -v /yourprojectfolder:/app/project steelburn/ionic

Of course, replace /yourproject with the actual directory of your project.

Environment variables

This container take environment variable, GITREPO, which should contain URL to git repository of the project. GITBRANCH variable can be used to indicate specific branch to be used. Otherwise, we'll use the main git branch. The script will automatically clone & run npm install and ionic build of the cloned project.

By default, once built, the code will be served by lighttpd. However, in certain cases, you may want to let it use built-in ng serve. This is achievable by passing SERVE variable to true.

You can also pass PWA variable, set to true. Use this if your application requires PWA registration and lighttpd or ng serve doesn't work.

Enable experimental SSL mode by passing an additional SSL variable, set to true. By passing SSL=true, you can also pass KEYPATH variable pointing to private key file; and CERTPATH variable, pointing to certificate file.

What the container will run?

There is a build.sh script, which will do the following:

  • switch to /app/project directory
  • run a git pull on regular interval (every 3 minutes)
  • if there's any new update from git repo, it'll run npm i and ionic build.

There's also a start.sh script, which is the mastermind to run build.sh and start Lighttpd HTTP server.

Script Flow
  • start.sh
    • build.sh

About

This docker image is maintained by @steelburn ( steelburn[a]gmail[dot]com )

Tag summary

Content type

Image

Digest

Size

81 MB

Last updated

almost 6 years ago

docker pull steelburn/ionic