-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New docker setup for emission-server (#618)
* Resolve conflict in start_script.sh * Resolve conflict in Dockerfile * Add composefile * Update docker README.md and Dockerfile * Update README * Moved everything into Dockerfile and deleted Dockerfile-base * Add Maintainer * Mount volume to store db data by default * Pull from emssion-server repo and install Vim
- Loading branch information
1 parent
004a5d4
commit e76681b
Showing
4 changed files
with
93 additions
and
52 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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
# python 3 | ||
FROM continuumio/miniconda3 | ||
|
||
MAINTAINER Attawit Kittikrairit | ||
|
||
MAINTAINER K. Shankari ([email protected]) | ||
# set working directory | ||
WORKDIR /usr/src/app | ||
|
||
# clone from repo | ||
RUN git clone https://github.com/e-mission/e-mission-server.git . | ||
|
||
# setup python environment | ||
# setup python environment. | ||
RUN conda env update --name emission --file setup/environment36.yml | ||
RUN /bin/bash -c "source activate emission; pip install six --upgrade" | ||
|
||
|
@@ -23,15 +22,20 @@ WORKDIR /usr/src/app/webapp | |
RUN bower update --allow-root | ||
WORKDIR /usr/src/app | ||
|
||
# install nano for editing | ||
# install nano and vim for editing | ||
RUN apt-get -y install nano vim | ||
|
||
# cleanup | ||
RUN apt-get -y remove --purge build-essential | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# start the server | ||
ADD docker/start_script.sh /usr/src/app/start_script.sh | ||
#declare environment variables | ||
ENV DB_HOST='' | ||
ENV WEB_SERVER_HOST='' | ||
|
||
#add start script. | ||
WORKDIR /usr/src/app | ||
ADD start_script.sh /usr/src/app/start_script.sh | ||
RUN chmod u+x /usr/src/app/start_script.sh | ||
|
||
EXPOSE 8080 | ||
|
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,42 @@ | ||
version: "3" | ||
services: | ||
web-server: | ||
image: emission-server | ||
depends_on: | ||
- db | ||
environment: | ||
- DB_HOST=db | ||
- WEB_SERVER_HOST=0.0.0.0 | ||
deploy: | ||
replicas: 1 | ||
restart_policy: | ||
condition: on-failure | ||
ports: | ||
#This is a default port mapping. In production you might want to use 80:8080, | ||
- "8080:8080" | ||
networks: | ||
- emission | ||
db: | ||
image: mongo:latest | ||
deploy: | ||
replicas: 1 | ||
restart_policy: | ||
condition: on-failure | ||
ports: | ||
#This port binding allows you to access the database server outside the host machine. Remove this is you don't need this | ||
#functionality | ||
- "27017:27017" | ||
|
||
#Volumes is the preferred way to persist data generated by a container. In this case we use a volume to persist the contents | ||
#of the data base. Learn more about how to use volumes here: https://docs.docker.com/storage/volumes/ | ||
# And learn how to configure volumes in your compose file here: https://docs.docker.com/compose/compose-file/#volume-configuration-reference | ||
volumes: | ||
- mongo-data:/data/db | ||
networks: | ||
- emission | ||
|
||
networks: | ||
emission: | ||
|
||
volumes: | ||
mongo-data: |
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