This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 193
/
Dockerfile
87 lines (67 loc) · 2.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Dockerfile for aws-serverless-auth-reference-app, to make it easy to quickly try out the mobile app
#
# Build Docker image
# docker build -t aws-serverless-auth-reference-app https://github.com/awslabs/aws-serverless-auth-reference-app.git
# docker build -t aws-serverless-auth-reference-app .
# Run Docker image
# docker run --rm -it -p 8100:8100 -p 35729:35729 aws-serverless-auth-reference-app
# # once you're running inside the Docker container
# aws configure # make sure to choose us-east-1 as the region
# cd ./api
# gulp deploy
# gulp bootstrap
# cd ../app
# ionic serve
# use http://localhost:8100 to browse and test app
# q to quit Ionic
# exit to exit the Docker container
#=========================================================================
FROM library/ubuntu:16.04
MAINTAINER Jim Tran and Justin Pirtle
WORKDIR /home/
ENV DIRPATH /home/aws-serverless-auth-reference-app/
# update apt repository packages
RUN apt-get update
# install the AWS CLI and Python pip dependency
RUN apt-get install -y python-pip
RUN pip install --upgrade pip
RUN pip install awscli
# install Node.js
RUN apt-get install -y python-software-properties
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
# set the Node.js npm logger level for build visibility (logging minimized by default)
# RUN npm config set loglevel info
# install git and pull down source code
RUN apt-get install -y git
RUN git clone --depth 1 https://github.com/awslabs/aws-serverless-auth-reference-app
RUN DIRPATH=$(pwd)/aws-serverless-auth-reference-app
# install the latest Gulp CLI tools globally (you will need a newer version of Gulp CLI which supports Gulp v4)
RUN npm install gulpjs/gulp-cli -g
# install the Node modules for the bootstrapping process
WORKDIR $DIRPATH/api/
RUN npm install
# install the Node modules for the Lambda run-time
WORKDIR $DIRPATH/api/lambda
RUN npm install
# install latest version of the Ionic CLI, Cordova, and Bower tools
RUN npm install -g ionic cordova bower
WORKDIR $DIRPATH/app
RUN npm install
# install the Bower crypto components (for AWS request signing) - omitted for now since bower components are statically embedded
# RUN echo '{ "allow_root": true }' > /root/.bowerrc
# RUN bower install
# install Cordova platform components if you would like to build the app for mobile
RUN cordova platform remove android
RUN cordova platform remove ios
RUN cordova platform add [email protected]
RUN cordova platform add [email protected]
# change prompt color
RUN echo 'export PS1="\[\033[0;33m\][Docker container (aws-serverless-auth-reference-app): \w] \[\033[0m\]"' >> /root/.bashrc
# start new shell with new prompt color
RUN bash
# Expose the Ionic ports
EXPOSE 8100 35729
WORKDIR $DIRPATH
# ENTRYPOINT aws configure && (cd api && gulp deploy) && (cd api && gulp bootstrap) && (cd app && ionic serve) && (cd api && gulp undeploy)