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

Docker build & run streamlining #55

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ RUN poetry install --no-dev --no-root
# Copy the rest of the application's files
COPY . .

RUN cp config/projects.example.json config/projects.json
RUN cp config/settings.example.json config/settings.json

# Make the shell scripts executable
RUN chmod +x ./snapshotter_autofill.sh ./init_docker.sh
RUN chmod +x ./snapshotter_autofill.sh ./docker-entrypoint.sh

# Start the application using PM2
# CMD pm2 start pm2.config.js && pm2 logs --lines 100

ENTRYPOINT ["/bin/bash", "-c", "./docker-entrypoint.sh"]
4 changes: 0 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ services:
- LOCAL_COLLECTOR_PORT=$LOCAL_COLLECTOR_PORT
- RELAYER_PRIVATE_KEY=$RELAYER_PRIVATE_KEY
- BLOCK_TIME=$BLOCK_TIME
command:
bash -c "bash server_autofill.sh && bash init_processes.sh"
networks:
- custom_network

Expand Down Expand Up @@ -62,8 +60,6 @@ services:
timeout: 5s
retries: 3
start_period: 30s
command:
bash -c "bash snapshotter_autofill.sh && bash init_docker.sh"
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
Expand Down
3 changes: 3 additions & 0 deletions init_docker.sh → docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Initializing settings...
./snapshotter_autofill.sh

# setting up git submodules
git submodule update --init --recursive

Expand Down
5 changes: 1 addition & 4 deletions snapshotter_autofill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ if [ "$NAMESPACE" ]; then
echo "Found NAMESPACE ${NAMESPACE}";
fi

cp config/projects.example.json config/projects.json
cp config/settings.example.json config/settings.json


export namespace="${NAMESPACE:-namespace_hash}"
export ipfs_url="${IPFS_URL:-}"
Expand Down Expand Up @@ -137,4 +134,4 @@ sed -i'.backup' "s#local-collector-port#$local_collector_port#" config/settings.
sed -i'.backup' "s#https://telegram-reporting-url#$telegram_reporting_url#" config/settings.json
sed -i'.backup' "s#telegram-chat-id#$telegram_chat_id#" config/settings.json

echo 'settings has been populated!'
echo 'settings have been populated!'