Skip to content

Commit

Permalink
Merge pull request #10 from SecretSaturn/Solana-docker
Browse files Browse the repository at this point in the history
Add Docker for Relayers
  • Loading branch information
SecretSaturn authored Sep 29, 2024
2 parents 11a7414 + fb77fd9 commit 1321a99
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 5 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/Docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Push Docker Image

on:
push:
branches:
- main # Change this to your default branch

jobs:
build_and_push:
runs-on: ubuntu-latest

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_NAME: secretpath
IMAGE_TAG: latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*\d')" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Docker Image
run: |
docker-compose build
docker-compose push
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.idea
TNLS-Relayers/etherscan_api_key.txt
*/.*
*/venv
*/__pycache__
.DS_Store
Expand Down Expand Up @@ -30,6 +28,5 @@ TNLS-Samples/RNG/contract.wasm.gz
/venv
/TNLS-Gateways/solana-gateway/.anchor/program-logs
/secret-deploy/node_modules
secret-deploy/secret_gateway.log
secret-deploy/secret_sample.log
/secret-deploy/node_modules
/secret-deploy/secret_gateway.log
/secret-deploy/secret_sample.log
3 changes: 3 additions & 0 deletions TNLS-Relayers/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ethereum-private-key = XXXXX
solana-private-key = XXXXX
secret-private-key = XXXXX
20 changes: 20 additions & 0 deletions TNLS-Relayers/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Python 3.11 runtime
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt .

# Install the dependencies specified in requirements.txt
RUN pip install --no-dependencies -r requirements.txt

# Copy the rest of your application code into the container
COPY . .

# Expose the port your app runs on
EXPOSE 8000

# Command to the relayer
CMD ["python3", "web_app.py"]
17 changes: 17 additions & 0 deletions TNLS-Relayers/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.8'

services:
tnls-relayer:
build:
context: ./ # Path to the build context
dockerfile: Dockerfile
image: your-dockerhub-username/your-image-name:latest
container_name: tnls-relayer
ports:
- "8000:8000" # Maps port 8000 on host to port 8000 in container
volumes:
- ./config.yml:/app/config.yml # Volume mapping for config.yml
environment: {}
#- ENV_VAR1=value1
#- ENV_VAR2=value2
restart: unless-stopped # Automatically restart container on failure

0 comments on commit 1321a99

Please sign in to comment.