diff --git a/configs/core/Dockerfile b/configs/core/Dockerfile index 04fbd31..3c31c91 100644 --- a/configs/core/Dockerfile +++ b/configs/core/Dockerfile @@ -48,16 +48,18 @@ RUN cd /app/laravel-application/vendor/gmajor/sr25519-bindings/go && go build -b FROM create-application as http-setup -# Set apache to listen on port 8000. -RUN sed -i "s/Listen 80/Listen 8000/" /etc/apache2/ports.conf - # Set ServerName to be localhost. RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf # Copy application to /var/www/html. COPY --from=composer-update /app/laravel-application /var/www/html +# Copy envs. +COPY configs/core/.env /var/www/html/.env +RUN dos2unix /var/www/html/.env + # Set permissions and ownership. +RUN chmod 777 -R /var/www/html/storage/ RUN chown -R www-data:www-data /var/www/ # Enable mod rewrite. diff --git a/configs/core/apache/000-default.conf b/configs/core/apache/000-default.conf index 42d6641..1c7d894 100644 --- a/configs/core/apache/000-default.conf +++ b/configs/core/apache/000-default.conf @@ -1,4 +1,4 @@ - + ServerAdmin webmaster@localhost DocumentRoot /var/www/html/public/ diff --git a/configs/core/start.sh b/configs/core/start.sh index 3c5dfee..39d8cc2 100755 --- a/configs/core/start.sh +++ b/configs/core/start.sh @@ -3,14 +3,12 @@ set -e role=${CONTAINER_ROLE:-app} -chmod -R 755 storage/logs || true -chown -hR www-data:www-data storage/logs || true - if [ "$role" = "ingest" ]; then echo "Running ingest..." (php artisan cache:clear && php artisan config:cache && php artisan migrate && php artisan platform:sync && php artisan platform:ingest) elif [ "$role" = "app" ]; then echo "Caching configuration..." + chown -hR www-data:www-data /var/www/html/storage/logs || true APP_KEY=$(awk '$1 ~ /^APP_KEY/' .env | cut -d "=" -f 2) if [ -z "$APP_KEY" ]; then php artisan key:generate @@ -20,6 +18,7 @@ elif [ "$role" = "app" ]; then exec apache2-foreground elif [ "$role" = "websocket" ]; then echo "Running queue and websocket..." + chown -hR www-data:www-data /var/www/html/storage/logs || true php artisan cache:clear && php artisan config:cache supervisord -n --configuration /etc/supervisor/supervisord.conf elif [ "$role" = "beam" ]; then diff --git a/configs/daemon/Dockerfile b/configs/daemon/Dockerfile index 8973ace..5b8702f 100644 --- a/configs/daemon/Dockerfile +++ b/configs/daemon/Dockerfile @@ -7,6 +7,7 @@ COPY /wallet-daemon . FROM rust:1.59.0-buster as cargo-build ARG PROFILE=release + ENV CARGO_HOME=/wallet/.cargo WORKDIR /wallet @@ -33,10 +34,15 @@ COPY --from=cargo-build /wallet/target/$PROFILE/wallet /usr/local/bin FROM slim as wallet-daemon LABEL org.opencontainers.image.source=https://github.com/enjin/wallet-daemon -LABEL org.opencontainers.image.description="Enjin Platform - Wallet Daemon" +LABEL org.opencontainers.image.description="Platform - Efinity Wallet Daemon" LABEL org.opencontainers.image.licenses=LGPL-3.0-only +COPY configs/daemon/config.json /opt/app/config.json +COPY configs/daemon/.env /usr/local/bin/.env COPY configs/daemon/start.sh /usr/local/bin/start + +RUN dos2unix /opt/app/config.json +RUN dos2unix /usr/local/bin/.env RUN dos2unix /usr/local/bin/start CMD ["/usr/local/bin/start"] diff --git a/configs/daemon/config.json b/configs/daemon/config.json index f415f64..e8e3045 100644 --- a/configs/daemon/config.json +++ b/configs/daemon/config.json @@ -1,5 +1,5 @@ { "node": "wss://rpc.matrix.blockchain.enjin.io:443", - "api": "http://app:8000/graphql", + "api": "http://app:80/graphql", "master_key": "/opt/app/storage" } diff --git a/docker-compose.yml b/docker-compose.yml index 79b109b..0ea04c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,12 +44,11 @@ services: CONTAINER_ROLE: app volumes: - ./logs:/var/www/html/storage/logs - - ./configs/core/.env:/var/www/html/.env depends_on: - database - redis ports: - - "${APP_EXTERNAL_PORT}:8000" + - "${APP_EXTERNAL_PORT}:80" extra_hosts: - "host.docker.internal:host-gateway" @@ -63,7 +62,6 @@ services: CONTAINER_ROLE: websocket volumes: - ./logs:/var/www/html/storage/logs - - ./configs/core/.env:/var/www/html/.env depends_on: - database - redis @@ -82,7 +80,6 @@ services: CONTAINER_ROLE: ingest volumes: - ./logs:/var/www/html/storage/logs - - ./configs/core/.env:/var/www/html/.env depends_on: - database - redis @@ -101,7 +98,6 @@ services: CONTAINER_ROLE: beam volumes: - ./logs:/var/www/html/storage/logs - - ./configs/core/.env:/var/www/html/.env depends_on: - database - redis @@ -118,8 +114,6 @@ services: dockerfile: configs/daemon/Dockerfile restart: unless-stopped volumes: - - ./configs/daemon/.env:/usr/bin/.env - - ./configs/daemon/config.json:/opt/app/config.json - ./configs/daemon/store:/opt/app/storage extra_hosts: - "host.docker.internal:host-gateway"