Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[PLA-1446] Add volumes (#26)" #28

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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