diff --git a/.dockerignore b/.dockerignore index 2fef4f0..b603cd3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,7 @@ env/ node_modules/ package-lock.json +yarn.lock app/node_modules/ app/package-lock.json +app/yarn.lock diff --git a/Dockerfile b/Dockerfile index 3cdfb50..dabc885 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,6 @@ 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 && \ diff --git a/app/package.json b/app/package.json index 519fab4..e1f22f8 100644 --- a/app/package.json +++ b/app/package.json @@ -38,7 +38,7 @@ "libp2p-websocket-star-rendezvous": "0.3.0" }, "scripts": { - "start": "HOST=${APELLA_HOST} react-scripts start", + "start": "react-scripts start", "rendezvous": "rendezvous --port=9090 --host=83.212.109.171", "build": "react-scripts build", "test": "react-scripts test", diff --git a/app/src/config/ipfsOptions.js b/app/src/config/ipfsOptions.js index b06c95e..2f592e7 100644 --- a/app/src/config/ipfsOptions.js +++ b/app/src/config/ipfsOptions.js @@ -1,3 +1,6 @@ +const REACT_APP_RENDEZVOUS_HOST = process.env.REACT_APP_RENDEZVOUS_HOST || '127.0.0.1'; +const REACT_APP_RENDEZVOUS_PORT = process.env.REACT_APP_RENDEZVOUS_PORT || '9090'; + // OrbitDB uses Pubsub which is an experimental feature // and need to be turned on manually. const ipfsOptions = { @@ -10,7 +13,7 @@ const ipfsOptions = { '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star', // Use local signaling server (see also rendezvous script in package.json) // For more information: https://github.com/libp2p/js-libp2p-websocket-star-rendezvous - '/dns4/' + process.env.REACT_APP_RENDEZVOUS_HOST + '/tcp/' + process.env.REACT_APP_RENDEZVOUS_PORT + '/ws/p2p-websocket-star', + '/dns4/' + REACT_APP_RENDEZVOUS_HOST + '/tcp/' + REACT_APP_RENDEZVOUS_PORT + '/ws/p2p-websocket-star', ] } }, diff --git a/docker-compose.yml b/docker-compose.yml index d6cc9d9..ae278e1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,8 +30,6 @@ services: - ./env/apella.env networks: - apella-net - volumes: - - ./volumes/node_modules:/usr/apella/node_modules expose: - "3000" @@ -57,11 +55,11 @@ services: - "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 + - conf:/etc/nginx/conf.d + - vhost:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + - dhparam:/etc/nginx/dhparam + - certs:/etc/nginx/certs:ro # Letsencrypt automated creation, renewal and use of Let's Encrypt certificates # Reference: @@ -79,14 +77,20 @@ services: 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 + - conf:/etc/nginx/conf.d + - vhost:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + - dhparam:/etc/nginx/dhparam + - certs:/etc/nginx/certs:rw - /var/run/docker.sock:/var/run/docker.sock:ro # Networks in use networks: apella-net: driver: bridge +volumes: + conf: + vhost: + html: + dhparam: + certs: \ No newline at end of file diff --git a/env/apella.env.example b/env/apella.env.example index 56f1372..a26340a 100644 --- a/env/apella.env.example +++ b/env/apella.env.example @@ -1,19 +1,23 @@ # Docker compose variables -VIRTUAL_HOST=apella.tk +VIRTUAL_HOST=example.com 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 +#LETSENCRYPT_HOST=example.com +#LETSENCRYPT_EMAIL=someemail.email.com # Variables needed in build time -# to_never_do: change bellow to localhost +# to_never_do: change APELLA_HOST to localhost APELLA_HOST=0.0.0.0 APELLA_PORT=3000 -GANACHE_HOST=79.103.177.105 +GANACHE_HOST=xx.xxx.xxx.xxx GANACHE_PORT=8545 +# react-scripts host and port vars +HOST=0.0.0.0 +PORT=3000 + # Variables needed in runtime (in browser) -REACT_APP_RENDEZVOUS_HOST=83.212.109.171 +REACT_APP_RENDEZVOUS_HOST=xx.xxx.xxx.xxx REACT_APP_RENDEZVOUS_PORT=9090 diff --git a/truffle-config.js b/truffle-config.js index 054efbe..f02e837 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -1,4 +1,6 @@ const path = require('path'); +const GANACHE_HOST = process.env.GANACHE_HOST || 'localhost'; +const GANACHE_PORT = process.env.GANACHE_PORT || '8545'; module.exports = { // See @@ -6,8 +8,8 @@ module.exports = { contracts_build_directory: path.join(__dirname, 'app/src/contracts'), networks: { development: { - host: process.env.GANACHE_HOST, - port: process.env.GANACHE_PORT, + host: GANACHE_HOST, + port: GANACHE_PORT, network_id: '*' // Match any network id } },