Skip to content

Commit

Permalink
Update docker labels, production docker-compose and simple fixes. (#824)
Browse files Browse the repository at this point in the history
* Fix docker build error for Web and update docs

* Update docker labels and add required args in docker-compose

* Update production docker-compose configuration

* revert passing args in docker-compose config
  • Loading branch information
kmehant authored and vivonk committed Aug 16, 2019
1 parent 5933843 commit 4ca33fd
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 82 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ We will be using docker-compose tool to build images and finally spin up all our

For development:
```bash
docker-compose up -f docker-compose.dev.yml --build
docker-compose -f docker-compose.dev.yml up --build
```
You can access the Bassa Web Client at port **3000** served by Gulp. <br>
For production:
Expand All @@ -88,6 +88,7 @@ docker-compose run [SERVICE NAME]

### Setting up Bassa from the source code
In order to to setup Bassa from the source code, you need a machine with either Linux, MacOS or Windows operating system.
Keep an eye on the configuration files such as dl.conf as they are specific to docker environment.

### Setting up Bassa on Linux based operating systems

Expand Down
18 changes: 9 additions & 9 deletions components/aria2c/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ WORKDIR /data
CMD ["aria2c", "--enable-rpc", "--rpc-listen-all"]

# Labels for dockerfile information
LABEL multi.org.label-schema.name="Bassa" \
multi.org.label-schema.description="Bassa provides Automated Download Queue to make the best use of Internet bandwidth" \
multi.org.label-schema.url="https://github.com/scorelab/Bassa/wiki" \
multi.org.label-schema.vcs-url="https://github.com/scorelab/Bassa" \
multi.org.label-schema.vcs-ref=$VCS_REF \
multi.org.label-schema.build-date=$BUILD_DATE \
multi.org.label-schema.vendor="Sustainable Computing Research Group" \
multi.org.label-schema.version="" \
multi.org.label-schema.schema-version="1.0"
LABEL scorelab.bassa.name="Aria2c RPC server" \
scorelab.bassa.description="Dockerfile for Aria2c RPC server" \
scorelab.bassa.url="https://github.com/scorelab/Bassa/wiki" \
scorelab.bassa.vcs-url="https://github.com/scorelab/Bassa" \
scorelab.bassa.vcs-ref=$VCS_REF \
scorelab.bassa.build-date=$BUILD_DATE \
scorelab.bassa.vendor="Sustainable Computing Research Group" \
scorelab.bassa.version="1.0" \
scorelab.bassa.schema-version="1.0"


18 changes: 9 additions & 9 deletions components/core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ EXPOSE 5000
CMD [ "python3", "Main.py" ]

# Adding data as docker labels
LABEL multi.org.label-schema.name="Bassa" \
multi.org.label-schema.description="Bassa provides Automated Download Queue to make the best use of Internet bandwidth" \
multi.org.label-schema.url="https://github.com/scorelab/Bassa/wiki" \
multi.org.label-schema.vcs-url="https://github.com/scorelab/Bassa" \
multi.org.label-schema.vcs-ref=$VCS_REF \
multi.org.label-schema.build-date=$BUILD_DATE \
multi.org.label-schema.vendor="Sustainable Computing Research Group" \
multi.org.label-schema.version="" \
multi.org.label-schema.schema-version="1.0"
LABEL scorelab.bassa.name="Bassa API development server" \
scorelab.bassa.description="Dockerfile for Bassa API flask-socketio server" \
scorelab.bassa.url="https://github.com/scorelab/Bassa/wiki" \
scorelab.bassa.vcs-url="https://github.com/scorelab/Bassa" \
scorelab.bassa.vcs-ref=$VCS_REF \
scorelab.bassa.build-date=$BUILD_DATE \
scorelab.bassa.vendor="Sustainable Computing Research Group" \
scorelab.bassa.version="1.0" \
scorelab.bassa.schema-version="1.0"
18 changes: 9 additions & 9 deletions components/core/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ CMD /usr/bin/supervisord -n -c ../etc/supervisor/supervisord.conf


# Adding data as docker labels
LABEL multi.org.label-schema.name="Bassa" \
multi.org.label-schema.description="Bassa provides Automated Download Queue to make the best use of Internet bandwidth" \
multi.org.label-schema.url="https://github.com/scorelab/Bassa/wiki" \
multi.org.label-schema.vcs-url="https://github.com/scorelab/Bassa" \
multi.org.label-schema.vcs-ref=$VCS_REF \
multi.org.label-schema.build-date=$BUILD_DATE \
multi.org.label-schema.vendor="Sustainable Computing Research Group" \
multi.org.label-schema.version="" \
multi.org.label-schema.schema-version="1.0"
LABEL scorelab.bassa.name="Bassa API production server" \
scorelab.bassa.description="Dockerfile for Bassa API flask-socketio server" \
scorelab.bassa.url="https://github.com/scorelab/Bassa/wiki" \
scorelab.bassa.vcs-url="https://github.com/scorelab/Bassa" \
scorelab.bassa.vcs-ref=$VCS_REF \
scorelab.bassa.build-date=$BUILD_DATE \
scorelab.bassa.vendor="Sustainable Computing Research Group" \
scorelab.bassa.version="1.0" \
scorelab.bassa.schema-version="1.0"
8 changes: 0 additions & 8 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ services:
BASSA_DB_NAME: Bassa
BASSA_DB_USERNAME: bassa
BASSA_DB_PASSWORD: bassa@1234
labels:
com.example.description: "Docker container for Bassa API server"

web:
build:
Expand All @@ -27,8 +25,6 @@ services:
- api
depends_on:
- db
labels:
com.example.description: "Docker container for Bassa Client"

aria2c:
build: components/aria2c/
Expand All @@ -40,8 +36,6 @@ services:
volumes:
- ./downloads:/data
restart: always
labels:
com.example.description: "Docker container for Aria2c RPC server"

db:
image: mysql:5.7
Expand All @@ -58,8 +52,6 @@ services:
MYSQL_USER: bassa
MYSQL_PASSWORD: bassa@1234
BASSA_DB_NAME: Bassa
labels:
com.example.description: "Docker container for Bassa Database"

volumes:
data-volume:
59 changes: 39 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,59 @@
version: "3"
services:
bassa-api:
build: components/core/
api:
build:
context: components/core/
dockerfile: Dockerfile.prod
container_name: api
ports:
- 5000:5000
depends_on:
links:
- db
volumes:
- ./downloads:/downloads
environment:
BASSA_DB_NAME: ${BASSA_DB_NAME}
BASSA_DB_USERNAME: ${BASSA_DB_USERNAME}
BASSA_DB_PASSWORD: ${BASSA_DB_PASSWORD}
labels:
com.example.description: "Docker container for Bassa Backend"
BASSA_DB_NAME: Bassa
BASSA_DB_USERNAME: bassa
BASSA_DB_PASSWORD: bassa@1234

web:
build: ui/
build:
context: ui/
dockerfile: Dockerfile
container_name: web
ports:
- 3000:80
- 80:80
links:
- api
depends_on:
- db
labels:
com.example.description: "Docker container for Bassa UI"

aria2c:
build: components/aria2c/
container_name: aria2c
links:
- api
ports:
- 6800:6800
volumes:
- ./downloads:/data
restart: always

db:
image: mysql
image: mysql:5.7
restart: always
volumes:
- data-volume:/var/lib/mysql
- data-volume:/var/lib/mysql
- ./.docker/volumes/mysql:/docker-entrypoint-initdb.d
- ./db_schema/:/tmp/schema
- ./db_schema/:/tmp/schema/
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${BASSA_DB_NAME}
MYSQL_USER: ${BASSA_DB_USERNAME}
MYSQL_PASSWORD: ${BASSA_DB_PASSWORD}
BASSA_DB_NAME: ${BASSA_DB_NAME}
MYSQL_ROOT_PASSWORD: bassa@1234
MYSQL_DATABASE: Bassa
MYSQL_USER: bassa
MYSQL_PASSWORD: bassa@1234
BASSA_DB_NAME: Bassa

volumes:
data-volume:
1 change: 1 addition & 0 deletions ui/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ README.md
# This should contain all files created during `npm run build`.
build
node_modules
package-lock.json
29 changes: 16 additions & 13 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#----------------------- Builder
FROM node:8-alpine as builder
FROM node:7 as builder

# Setting the current work directory to ui
WORKDIR /ui

# Copying complete ui component in to the container
COPY . .

# Installing node modules
RUN apk update && \
# Installing node modules and bower modules
RUN apt-get update && \
npm install && \
npm install --global bower gulp-cli
npm install --global bower gulp-cli && \
bower --allow-root install



# Building the ui component to obtain static files.
RUN gulp build
Expand All @@ -30,12 +33,12 @@ COPY --from=builder /ui/dist/ /usr/share/nginx/html
EXPOSE 80

# Adding metadata as docker labels
LABEL multi.org.label-schema.name="Bassa" \
multi.org.label-schema.description="Bassa provides Automated Download Queue to make the best use of Internet bandwidth" \
multi.org.label-schema.url="https://github.com/scorelab/Bassa/wiki" \
multi.org.label-schema.vcs-url="https://github.com/scorelab/Bassa" \
multi.org.label-schema.vcs-ref=$VCS_REF \
multi.org.label-schema.build-date=$BUILD_DATE \
multi.org.label-schema.vendor="Sustainable Computing Research Group" \
multi.org.label-schema.version="" \
multi.org.label-schema.schema-version="1.0"
LABEL scorelab.bassa.name="Bassa Web production server" \
scorelab.bassa.description="Dockerfile for Bassa Web Nginx server" \
scorelab.bassa.url="https://github.com/scorelab/Bassa/wiki" \
scorelab.bassa.vcs-url="https://github.com/scorelab/Bassa" \
scorelab.bassa.vcs-ref=$VCS_REF \
scorelab.bassa.build-date=$BUILD_DATE \
scorelab.bassa.vendor="Sustainable Computing Research Group" \
scorelab.bassa.version="1.0" \
scorelab.bassa.schema-version="1.0"
27 changes: 14 additions & 13 deletions ui/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8-alpine
FROM node:7

MAINTAINER SCoRe Lab Community <[email protected]>

Expand All @@ -13,21 +13,22 @@ COPY . .
# Exposing port for accessing the web interface
EXPOSE 3000

# Installing node modules
RUN apk update && \
# Installing node modules and bower modules
RUN apt-get update && \
npm install && \
npm install --global bower gulp-cli
npm install --global bower gulp-cli && \
bower --allow-root install

# Starting gulp server
CMD ["gulp", "serve"]

# labels to dockerfile
LABEL multi.org.label-schema.name="Bassa" \
multi.org.label-schema.description="Bassa provides Automated Download Queue to make the best use of Internet bandwidth" \
multi.org.label-schema.url="https://github.com/scorelab/Bassa/wiki" \
multi.org.label-schema.vcs-url="https://github.com/scorelab/Bassa" \
multi.org.label-schema.vcs-ref=$VCS_REF \
multi.org.label-schema.build-date=$BUILD_DATE \
multi.org.label-schema.vendor="Sustainable Computing Research Group" \
multi.org.label-schema.version="" \
multi.org.label-schema.schema-version="1.0"
LABEL scorelab.bassa.name="Bassa Web development server" \
scorelab.bassa.description="Dockerfile for Bassa Web" \
scorelab.bassa.url="https://github.com/scorelab/Bassa/wiki" \
scorelab.bassa.vcs-url="https://github.com/scorelab/Bassa" \
scorelab.bassa.vcs-ref=$VCS_REF \
scorelab.bassa.build-date=$BUILD_DATE \
scorelab.bassa.vendor="Sustainable Computing Research Group" \
scorelab.bassa.version="1.0" \
scorelab.bassa.schema-version="1.0"

0 comments on commit 4ca33fd

Please sign in to comment.