-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
18 changed files
with
251 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node_modules/ | ||
.git/ | ||
coverage/ | ||
|
||
.dockerignore | ||
Dockerfile | ||
|
||
.gitignore | ||
.env | ||
.eslintrc | ||
.editorconfig | ||
.travis.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
FROM node:6.11-alpine | ||
|
||
WORKDIR /root | ||
|
||
RUN apk update ;\ | ||
apk add --no-cache curl git | ||
apk add --no-cache curl git ;\ | ||
#CORS DOWNLOAD | ||
npm install -g add-cors-to-couchdb | ||
|
||
WORKDIR /root | ||
|
||
COPY ./docker-entrypoint.sh /root/docker-entrypoint.sh | ||
COPY ./docker/db-init/docker-entrypoint.sh /root/docker-entrypoint.sh | ||
COPY ./couchdb-setup.sh /root/couchdb-setup.sh | ||
ADD ./design /root/design | ||
|
||
CMD sh ./docker-entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
FROM arm32v7/node:6.11-slim | ||
FROM hypriot/rpi-node:6.10.0-alpine | ||
RUN apk update ;\ | ||
apk add --no-cache curl git ;\ | ||
#CORS DOWNLOAD | ||
npm install -g add-cors-to-couchdb | ||
|
||
WORKDIR /root | ||
|
||
RUN apt-get update ;\ | ||
apt-get install git curl -y | ||
|
||
COPY ./docker-entrypoint.sh /root/docker-entrypoint.sh | ||
COPY ./docker/db-init/docker-entrypoint.sh /root/docker-entrypoint.sh | ||
COPY ./couchdb-setup.sh /root/couchdb-setup.sh | ||
ADD ./design /root/design | ||
|
||
CMD sh ./docker-entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM node:6.11-stretch | ||
|
||
MAINTAINER Abdurrachman Mappuji <[email protected]> | ||
|
||
ENV APP planet | ||
|
||
# install required software before using nvm/node/npm/bower | ||
RUN apt-get update \ | ||
&& apt-get install -y curl git python build-essential \ | ||
# install angular cli | ||
&& npm install -g @angular/cli | ||
|
||
# exposes port 3000 but your app may use any port specified in it | ||
EXPOSE 3000 | ||
|
||
VOLUME ["/$APP"] | ||
WORKDIR /$APP | ||
|
||
#ADD ./docker-entrypoint.sh docker-entrypoint.sh | ||
|
||
#ENTRYPOINT ["/bin/bash", "-c"] | ||
CMD bash -c 'npm install && ng serve' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM arm32v7/node:6.11-stretch | ||
|
||
MAINTAINER Abdurrachman Mappuji <[email protected]> | ||
|
||
ENV APP planet | ||
|
||
# install required software before using nvm/node/npm/bower | ||
RUN apt-get update \ | ||
&& apt-get install -y curl git python build-essential \ | ||
# install angular cli | ||
&& npm install -g @angular/cli | ||
|
||
RUN npm rebuild node-sass | ||
|
||
# exposes port 3000 but your app may use any port specified in it | ||
EXPOSE 3000 | ||
|
||
VOLUME ["/$APP"] | ||
WORKDIR /$APP | ||
|
||
#ADD ./docker-entrypoint.sh docker-entrypoint.sh | ||
|
||
#ENTRYPOINT ["/bin/bash", "-c"] | ||
CMD bash -c 'npm install && npm rebuild node-sass && ng serve --host 0.0.0.0 --disable-host-check' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
services: | ||
couchdb: | ||
expose: | ||
- 5984 | ||
image: klaemo/couchdb | ||
ports: | ||
- "2200:5984" | ||
- "2201:5986" | ||
db-init: | ||
image: treehouses/planet:db-init-latest | ||
depends_on: | ||
- couchdb | ||
planet: | ||
image: treehouses/planet:latest | ||
ports: | ||
- "80:80" | ||
environment: | ||
- HOST_PROTOCOL=http | ||
- DB_HOST=127.0.0.1 | ||
- DB_PORT=2200 | ||
depends_on: | ||
- couchdb | ||
version: "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
FROM node:6.11-stretch | ||
|
||
### STAGE 1: Build ### | ||
# We label our stage as ‘builder’ | ||
FROM node:6.11-alpine as builder | ||
MAINTAINER Abdurrachman Mappuji <[email protected]> | ||
COPY package.json ./ | ||
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build | ||
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app | ||
WORKDIR /ng-app | ||
COPY . . | ||
## Build the angular app in production mode and store the artifacts in dist folder | ||
RUN $(npm bin)/ng build --prod | ||
|
||
ENV APP planet | ||
|
||
# install required software before using nvm/node/npm/bower | ||
RUN apt-get update \ | ||
&& apt-get install -y curl git python build-essential \ | ||
# install angular cli | ||
&& npm install -g @angular/cli | ||
|
||
# exposes port 3000 but your app may use any port specified in it | ||
EXPOSE 3000 | ||
|
||
VOLUME ["/$APP"] | ||
WORKDIR /$APP | ||
|
||
#ADD ./docker-entrypoint.sh docker-entrypoint.sh | ||
|
||
#ENTRYPOINT ["/bin/bash", "-c"] | ||
CMD bash -c 'npm install && ng serve' | ||
### STAGE 2: Setup ### | ||
FROM nginx:1.13.3-alpine | ||
## Copy our default nginx config | ||
COPY docker/planet/default.conf /etc/nginx/conf.d/ | ||
## Remove default nginx website | ||
RUN rm -rf /usr/share/nginx/html/* | ||
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder | ||
COPY --from=builder /ng-app/dist /usr/share/nginx/html | ||
COPY docker/planet/docker-entrypoint.sh ./ | ||
CMD sh ./docker-entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
server { | ||
|
||
listen 80; | ||
|
||
sendfile on; | ||
|
||
default_type application/octet-stream; | ||
|
||
|
||
gzip on; | ||
gzip_http_version 1.1; | ||
gzip_disable "MSIE [1-6]\."; | ||
gzip_min_length 1100; | ||
gzip_vary on; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
gzip_comp_level 9; | ||
|
||
|
||
root /usr/share/nginx/html; | ||
|
||
|
||
location / { | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$HOST_PROTOCOL" ] | ||
then | ||
PROTOCOL="http" | ||
elif [ "$HOST_PROTOCOL" = "https" ] | ||
then | ||
PROTOCOL="https" | ||
else | ||
PROTOCOL="http" | ||
fi | ||
|
||
sed -i -e "s#planet-db-host#$PROTOCOL://$DB_HOST#g" /usr/share/nginx/html/main* | ||
sed -i -e "s#planet-db-port#$DB_PORT#g" /usr/share/nginx/html/main* | ||
|
||
nginx -g "daemon off;" | ||
|
Oops, something went wrong.