Skip to content

Commit

Permalink
Revert "[PLA-1446] Add volumes (#26)"
Browse files Browse the repository at this point in the history
This reverts commit b02d04a.
  • Loading branch information
leonardocustodio committed Nov 29, 2023
1 parent 423bf50 commit 53e0fc2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
8 changes: 5 additions & 3 deletions configs/core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion configs/core/apache/000-default.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<VirtualHost *:8000>
<VirtualHost *:80>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public/
Expand Down
5 changes: 2 additions & 3 deletions configs/core/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion configs/daemon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion configs/daemon/config.json
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 1 addition & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 53e0fc2

Please sign in to comment.