mirror of https://gitlab.com/ecentrics/concordia
Apostolos Fanakis
5 years ago
14 changed files with 225 additions and 5 deletions
@ -0,0 +1,5 @@ |
|||||
|
env/ |
||||
|
node_modules/ |
||||
|
package-lock.json |
||||
|
app/node_modules/ |
||||
|
app/package-lock.json |
@ -0,0 +1,51 @@ |
|||||
|
# ----- Base image ----- |
||||
|
FROM tarampampam/node:11-alpine as base |
||||
|
LABEL maintainer="apotwohd@gmail.com" |
||||
|
|
||||
|
ENV DOCKER true |
||||
|
|
||||
|
# Installs a couple (dozen) more tools like python, c++, make and others |
||||
|
RUN apk --no-cache add build-base |
||||
|
|
||||
|
# Installs a couple (dozen) more tools like python, c++, make and others |
||||
|
RUN apk --no-cache add build-base \ |
||||
|
python3 && \ |
||||
|
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi |
||||
|
|
||||
|
# Installs truffle |
||||
|
RUN yarn global add truffle |
||||
|
|
||||
|
WORKDIR /usr/apella |
||||
|
|
||||
|
COPY ./package.json ./ |
||||
|
COPY ./app/package.json ./app/ |
||||
|
|
||||
|
# ----- Dependencies ----- |
||||
|
FROM base as dependencies |
||||
|
|
||||
|
# Installs node packages from ./package.json |
||||
|
RUN yarn install |
||||
|
|
||||
|
# Installs node packages from ./app/package.json |
||||
|
RUN cd app/ && yarn install |
||||
|
|
||||
|
# ----- Test ----- |
||||
|
#FROM dependencies AS test |
||||
|
|
||||
|
# Preps directories |
||||
|
#COPY . . |
||||
|
# Runs linters and tests |
||||
|
#RUN npm run lint && npm run test |
||||
|
|
||||
|
# ----- Runtime ----- |
||||
|
FROM base as runtime |
||||
|
|
||||
|
# Copies node_modules |
||||
|
COPY --from=dependencies /usr/apella/node_modules ./node_modules |
||||
|
COPY --from=dependencies /usr/apella/app/node_modules ./app/node_modules |
||||
|
|
||||
|
# Preps directories |
||||
|
COPY . . |
||||
|
|
||||
|
RUN ["chmod", "+x", "/usr/apella/migrateAndStart.sh"] |
||||
|
ENTRYPOINT ["/usr/apella/migrateAndStart.sh"] |
@ -0,0 +1,10 @@ |
|||||
|
build: |
||||
|
@docker-compose -p apella build; |
||||
|
run: |
||||
|
@docker-compose -p apella up -d |
||||
|
stop: |
||||
|
@docker-compose -p apella down |
||||
|
clean-data: |
||||
|
@docker-compose -p apella down -v |
||||
|
clean-images: |
||||
|
@docker rmi `docker images -q -f "dangling=true"` |
@ -0,0 +1,92 @@ |
|||||
|
version: '3.7' |
||||
|
|
||||
|
services: |
||||
|
ganache: |
||||
|
build: ./ganache |
||||
|
container_name: ganache |
||||
|
restart: always |
||||
|
ports: |
||||
|
- "8545:8545" |
||||
|
user: root |
||||
|
volumes: |
||||
|
- ./volumes/ganache_db:/home/ganache_db |
||||
|
- ./volumes/ganache_keys:/home/ganache_keys |
||||
|
|
||||
|
# Simple rendezvous server image |
||||
|
# Reference: |
||||
|
# https://hub.docker.com/r/libp2p/websocket-star-rendezvous |
||||
|
rendezvous: |
||||
|
image: libp2p/websocket-star-rendezvous:release |
||||
|
container_name: rendezvous |
||||
|
restart: always |
||||
|
ports: |
||||
|
- "9090:9090" |
||||
|
|
||||
|
apella: |
||||
|
build: ./ |
||||
|
container_name: apella-app |
||||
|
restart: always |
||||
|
env_file: |
||||
|
- ./env/apella.env |
||||
|
networks: |
||||
|
- apella-net |
||||
|
volumes: |
||||
|
- ./volumes/node_modules:/usr/apella/node_modules |
||||
|
expose: |
||||
|
- "3000" |
||||
|
|
||||
|
# Nginx reverse proxy container |
||||
|
# Reference: |
||||
|
# https://github.com/jwilder/nginx-proxy |
||||
|
nginx-proxy: # TODO: maybe split this to the two underlying images? |
||||
|
image: jwilder/nginx-proxy |
||||
|
container_name: apella-nginx-proxy |
||||
|
restart: always |
||||
|
environment: |
||||
|
- DEFAULT_HOST=apella.tk |
||||
|
labels: |
||||
|
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" |
||||
|
logging: |
||||
|
options: |
||||
|
max-size: '4m' |
||||
|
max-file: '10' |
||||
|
networks: |
||||
|
- apella-net |
||||
|
ports: |
||||
|
- "80:80" |
||||
|
- "443:443" |
||||
|
volumes: |
||||
|
- /var/run/docker.sock:/tmp/docker.sock:ro |
||||
|
- ./volumes/nginx/conf:/etc/nginx/conf.d |
||||
|
- ./volumes/nginx/vhost:/etc/nginx/vhost.d |
||||
|
- ./volumes/nginx/html:/usr/share/nginx/html |
||||
|
- ./volumes/nginx/dhparam:/etc/nginx/dhparam |
||||
|
- ./volumes/nginx/certs:/etc/nginx/certs:ro |
||||
|
|
||||
|
# Letsencrypt automated creation, renewal and use of Let's Encrypt certificates |
||||
|
# Reference: |
||||
|
# https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion |
||||
|
letsencrypt: |
||||
|
image: jrcs/letsencrypt-nginx-proxy-companion |
||||
|
container_name: apella-proxy-le |
||||
|
restart: always |
||||
|
depends_on: |
||||
|
- nginx-proxy |
||||
|
logging: |
||||
|
options: |
||||
|
max-size: '4m' |
||||
|
max-file: '10' |
||||
|
networks: |
||||
|
- apella-net |
||||
|
volumes: |
||||
|
- ./volumes/nginx/conf:/etc/nginx/conf.d |
||||
|
- ./volumes/nginx/vhost:/etc/nginx/vhost.d |
||||
|
- ./volumes/nginx/html:/usr/share/nginx/html |
||||
|
- ./volumes/nginx/dhparam:/etc/nginx/dhparam |
||||
|
- ./volumes/nginx/certs:/etc/nginx/certs:rw |
||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro |
||||
|
|
||||
|
# Networks in use |
||||
|
networks: |
||||
|
apella-net: |
||||
|
driver: bridge |
@ -0,0 +1,19 @@ |
|||||
|
# Docker compose variables |
||||
|
VIRTUAL_HOST=apella.tk |
||||
|
VIRTUAL_PORT=3000 |
||||
|
|
||||
|
# If you uncomment the lines below, Apella will become available through https BUT the rendezvous |
||||
|
# server will stop working and IPFS initialization won't complete |
||||
|
#LETSENCRYPT_HOST=apella.tk |
||||
|
#LETSENCRYPT_EMAIL=apotwohd@gmail.com |
||||
|
|
||||
|
# Variables needed in build time |
||||
|
# to_never_do: change bellow to localhost |
||||
|
APELLA_HOST=0.0.0.0 |
||||
|
APELLA_PORT=3000 |
||||
|
GANACHE_HOST=79.103.177.105 |
||||
|
GANACHE_PORT=8545 |
||||
|
|
||||
|
# Variables needed in runtime (in browser) |
||||
|
REACT_APP_RENDEZVOUS_HOST=83.212.109.171 |
||||
|
REACT_APP_RENDEZVOUS_PORT=9090 |
@ -0,0 +1,5 @@ |
|||||
|
FROM trufflesuite/ganache-cli:latest |
||||
|
|
||||
|
RUN mkdir /home/ganache_db /home/ganache_keys |
||||
|
|
||||
|
ENTRYPOINT ["node", "/app/ganache-core.docker.cli.js", "-a", "10", "-e", "1000", "-d", "-m", "measure tree magic expire dad extend famous offer slight glory inherit weekend", "-p", "8545", "-i", "5778", "--db", "/home/ganache_db/", "-v", "--account_keys_path", "/home/ganache_keys/keys", "--allowUnlimitedContractSize", "--noVMErrorsOnRPCResponse"] |
@ -0,0 +1,13 @@ |
|||||
|
version: '3.7' |
||||
|
|
||||
|
services: |
||||
|
ganache: |
||||
|
build: ./ |
||||
|
container_name: ganache |
||||
|
restart: always |
||||
|
ports: |
||||
|
- "8545:8545" |
||||
|
user: root |
||||
|
volumes: |
||||
|
- ./volumes/ganache_db:/home/ganache_db |
||||
|
- ./volumes/ganache_keys:/home/ganache_keys |
@ -0,0 +1,9 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# Migrates contracts |
||||
|
rm -f /usr/apella/app/src/contracts/* |
||||
|
cd /usr/apella/ |
||||
|
truffle migrate |
||||
|
|
||||
|
cd /usr/apella/app/ |
||||
|
yarn start |
@ -0,0 +1,4 @@ |
|||||
|
FROM libp2p/websocket-star-rendezvous:release |
||||
|
|
||||
|
# Can't use the array form of ENTRYPOINT here because we use env vars |
||||
|
ENTRYPOINT /usr/local/bin/dumb-init node --max-old-space-size=8192 src/bin.js --port="$RENDEZVOUS_PORT" |
@ -0,0 +1,9 @@ |
|||||
|
version: '3.7' |
||||
|
|
||||
|
services: |
||||
|
rendezvous: |
||||
|
image: libp2p/websocket-star-rendezvous:release |
||||
|
container_name: rendezvous |
||||
|
restart: always |
||||
|
ports: |
||||
|
- "9090:9090" |
Loading…
Reference in new issue