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

V2 stable #7

Open
wants to merge 19 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules
dist
.tmp
.saas-cache
bower_components
screenshots
*~
*.swp
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ node_modules
dist
.tmp
.sass-cache
bower_components
*~
*.swp
97 changes: 49 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,59 @@
FROM debian:jessie
MAINTAINER "Konrad Kleine"
################################################################################
# Stage 1: Build the Angluar application
################################################################################
FROM node:8-alpine as build_app
LABEL maintainer="Konrad Kleine"

ENV WORKDIR=/usr/src
RUN mkdir -p $WORKDIR \
$WORKDIR/.git

WORKDIR $WORKDIR

# The node image removes these packages as they are only needed to build node not to run it
# Since we are installing/building npm packages will need these in the image
RUN apk add --no-cache --virtual .build-deps \
automake \
autoconf \
gcc \
g++ \
make \
nasm \
python \
zlib-dev

COPY . $WORKDIR

RUN npm install \
&& apk del .build-deps

# Add some git files for versioning
ADD .git/HEAD $WORKDIR/.git/HEAD
ADD .git/refs $WORKDIR/.git/refs

# Create version file
RUN export GITREF=$(cat .git/HEAD | cut -d" " -f2) && \
export GITSHA1=$(cat .git/$GITREF) && \
echo "{\"git\": {\"sha1\": \"$GITSHA1\", \"ref\": \"$GITREF\"}}" > app-version.json

## Build App
RUN node_modules/grunt-cli/bin/grunt build --allow-root


################################################################################
# Stage 2: Run the Angular application
################################################################################

FROM debian:jessie
LABEL maintainer="Konrad Kleine"

USER root

############################################################
# Setup environment variables
############################################################

ENV WWW_DIR /var/www/html
ENV SOURCE_DIR /tmp/source
ENV START_SCRIPT /root/start-apache.sh

RUN mkdir -pv $WWW_DIR
Expand All @@ -28,32 +72,8 @@ RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache

############################################################

# Create dirs
RUN mkdir -p $SOURCE_DIR/dist \
$SOURCE_DIR/app \
$SOURCE_DIR/test \
$SOURCE_DIR/.git

# Add dirs
ADD app $SOURCE_DIR/app
ADD test $SOURCE_DIR/test

# Dot files
ADD .jshintrc $SOURCE_DIR/
ADD .bowerrc $SOURCE_DIR/
ADD .editorconfig $SOURCE_DIR/
ADD .travis.yml $SOURCE_DIR/

# Other files
ADD bower.json $SOURCE_DIR/
ADD Gruntfile.js $SOURCE_DIR/
ADD LICENSE $SOURCE_DIR/
ADD package.json $SOURCE_DIR/
ADD README.md $SOURCE_DIR/

# Add some git files for versioning
ADD .git/HEAD $SOURCE_DIR/.git/HEAD
ADD .git/refs $SOURCE_DIR/.git/refs
COPY --from=build_app /usr/src/dist/ $WWW_DIR/
COPY --from=build_app /usr/src/app-version.json $WWW_DIR/app-version.json

############################################################
# Install and configure webserver software
Expand All @@ -63,30 +83,11 @@ RUN apt-get -y update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y install \
apache2 \
bzip2 \
libapache2-mod-auth-kerb \
libapache2-mod-proxy-html \
git \
nodejs \
nodejs-legacy \
npm \
--no-install-recommends && \
a2enmod proxy && \
a2enmod proxy_http && \
cd $SOURCE_DIR && \
export GITREF=$(cat .git/HEAD | cut -d" " -f2) && \
export GITSHA1=$(cat .git/$GITREF) && \
echo "{\"git\": {\"sha1\": \"$GITSHA1\", \"ref\": \"$GITREF\"}}" > $WWW_DIR/app-version.json && \
cd $SOURCE_DIR && \
rm -rf $SOURCE_DIR/.git && \
git config --global url."https://".insteadOf git:// && \
cd $SOURCE_DIR && \
npm install && \
node_modules/bower/bin/bower install --allow-root && \
node_modules/grunt-cli/bin/grunt build --allow-root && \
cp -rf $SOURCE_DIR/dist/* $WWW_DIR && \
rm -rf $SOURCE_DIR && \
apt-get -y --auto-remove purge git nodejs nodejs-legacy npm bzip2 && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
34 changes: 6 additions & 28 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function (grunt) {

// Configurable paths for the application
var appConfig = {
app: require('./bower.json').appPath || 'app',
app: 'app',
dist: 'dist'
};

Expand All @@ -34,10 +34,6 @@ module.exports = function (grunt) {

// Watches files for changes and runs tasks based on the changed files
watch: {
bower: {
files: ['bower.json'],
tasks: ['wiredep']
},
js: {
files: ['<%= yeoman.app %>/{,*/}*.js'],
tasks: ['newer:jshint:all'],
Expand Down Expand Up @@ -105,8 +101,8 @@ module.exports = function (grunt) {
middlewares.push(
connect.static('.tmp'),
connect().use(
'/bower_components',
connect.static('./bower_components')
'/node_modules',
connect.static('./node_modules')
),
connect.static(appConfig.app)
);
Expand All @@ -123,8 +119,8 @@ module.exports = function (grunt) {
connect.static('.tmp'),
connect.static('test'),
connect().use(
'/bower_components',
connect.static('./bower_components')
'/node_modules',
connect.static('./node_modules')
),
connect.static(appConfig.app)
];
Expand Down Expand Up @@ -189,14 +185,6 @@ module.exports = function (grunt) {
}
},

// Automatically inject Bower components into the app
wiredep: {
app: {
src: ['<%= yeoman.app %>/index.html'],
ignorePath: /\.\.\//
}
},

// Renames files for browser caching purposes
filerev: {
dist: {
Expand Down Expand Up @@ -316,13 +304,6 @@ module.exports = function (grunt) {
}
},

// Replace Google CDN references
cdnify: {
dist: {
html: ['<%= yeoman.dist %>/*.html']
}
},

// Copies remaining files to places other tasks can use
copy: {
dist: {
Expand All @@ -346,7 +327,7 @@ module.exports = function (grunt) {
src: ['generated/*']
}, {
expand: true,
cwd: 'bower_components/bootstrap/dist',
cwd: 'node_modules/bootstrap/dist',
src: 'fonts/*',
dest: '<%= yeoman.dist %>'
}]
Expand Down Expand Up @@ -391,7 +372,6 @@ module.exports = function (grunt) {

grunt.task.run([
'clean:server',
'wiredep',
'concurrent:server',
'autoprefixer',
'configureProxies:server',
Expand All @@ -415,14 +395,12 @@ module.exports = function (grunt) {

grunt.registerTask('build', [
'clean:dist',
'wiredep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngAnnotate',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'filerev',
Expand Down
8 changes: 4 additions & 4 deletions app/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ <h3>Grunt</h3>
</div>
<div class="col-xs-12 col-md-3">
<div class="thumbnail">
<img src="images/tool-bower.png" alt="Bower">
<img src="images/tool-npm.png" alt="NPM">
<div class="caption">
<h3>Bower</h3>
<p>The Bower package manager is used to manage all the dependencies of the code.</p>
<p><a href="http://bower.io/" class="btn btn-primary" role="button">Checkout Bower</a> </p>
<h3>NPM</h3>
<p>The NPM package manager is used to manage all the dependencies of the code.</p>
<p><a href="http://npmjs.com/" class="btn btn-primary" role="button">Checkout NPM</a> </p>
</div>
</div>
</div>
Expand Down
9 changes: 2 additions & 7 deletions app/image/image-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ angular.module('image-controller', ['registry-services', 'app-mode-services'])

$scope.appMode = AppMode.query();
$scope.totalImageSize = 0;
$scope.imageDetails = Manifest.query({repoUser: $scope.repositoryUser, repoName: $scope.repositoryName, tagName: $scope.tagName});

$scope.imageDetails = Manifest.query({repository: $scope.repository, tagName: $scope.tagName});



Expand All @@ -30,11 +29,7 @@ angular.module('image-controller', ['registry-services', 'app-mode-services'])
$scope.totalImageSize = 0;
var size;
angular.forEach($scope.imageDetails.fsLayers, function (id, key) {

Blob.query({repoUser: $scope.repositoryUser, repoName: $scope.repositoryName, digest: id.blobSum}).$promise.then( function(data, headers){
size = data;
console.log(data)
console.log(size)
Blob.query({repository: $scope.repository, digest: id.blobSum}).$promise.then(function(data){
if(!isNaN(data.contentLength-0)){
$scope.totalImageSize += data.contentLength;
}
Expand Down
Binary file removed app/images/tool-bower.png
Binary file not shown.
Binary file added app/images/tool-npm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 26 additions & 26 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="bower_components/toastr/toastr.css" />
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.css" />
<!-- endbower -->
<!-- npm:css -->
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="node_modules/toastr/toastr.css" />
<link rel="stylesheet" href="node_modules/angular-loading-bar/build/loading-bar.css" />
<!-- endnpm -->
<!-- endbuild -->
<!-- build:css(.tmp) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
Expand Down Expand Up @@ -47,31 +47,31 @@ <h3 class="text-muted">Docker Registry Frontend</h3>

<!-- build:js(.) scripts/oldieshim.js -->
<!--[if lt IE 9]>
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.js"></script>
<script src="node_modules/es5-shim/es5-shim.js"></script>
<script src="node_modules/json3/lib/json3.js"></script>
<![endif]-->
<!-- endbuild -->

<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/toastr/toastr.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/angular-loading-bar/build/loading-bar.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/angular-moment/angular-moment.js"></script>
<script src="bower_components/angular-smart-table/dist/smart-table.min.js"></script>
<script src="bower_components/angular-filter/dist/angular-filter.min.js"></script>
<script src="bower_components/angular-bootstrap-checkbox/angular-bootstrap-checkbox.js"></script>
<!-- endbower -->
<!-- npm:js -->
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/angular/angular.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
<script src="node_modules/angular-resource/angular-resource.js"></script>
<script src="node_modules/angular-cookies/angular-cookies.js"></script>
<script src="node_modules/angular-sanitize/angular-sanitize.js"></script>
<script src="node_modules/angular-animate/angular-animate.js"></script>
<script src="node_modules/angular-touch/angular-touch.js"></script>
<script src="node_modules/angular-route/angular-route.js"></script>
<script src="node_modules/toastr/toastr.js"></script>
<script src="node_modules/angular-ui-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="node_modules/angular-loading-bar/build/loading-bar.js"></script>
<script src="node_modules/moment/moment.js"></script>
<script src="node_modules/angular-moment/angular-moment.js"></script>
<script src="node_modules/angular-smart-table/dist/smart-table.min.js"></script>
<script src="node_modules/angular-filter/dist/angular-filter.js"></script>
<script src="node_modules/angular-bootstrap-checkbox/angular-bootstrap-checkbox.js"></script>
<!-- endnpm -->
<!-- endbuild -->

<!-- build:js({.tmp,app}) scripts/scripts.js -->
Expand Down
Loading