Skip to content

Commit

Permalink
fixe issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aymen-Tirchi committed Sep 18, 2023
1 parent 7e22bc1 commit a9132fe
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 181 deletions.
135 changes: 39 additions & 96 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,127 +1,70 @@
version: '3'

services:

build-optimism:
build:
common:
build:
context: ./docker
dockerfile: Dockerfile.build-optimism
volumes:
dockerfile: Dockerfile.op-stack
volumes:
- ./op-stack-deployer:/app
working_dir: /app
command: go run cmd/1_build_optimism/main.go
networks:
networks:
- op-network


build-optimism:
extends:
service: common
command: go run cmd/1_build_optimism/main.go

build-op-geth:
build:
context: ./docker
dockerfile: Dockerfile.build-op-geth
volumes:
- ./op-stack-deployer:/app
working_dir: /app
extends:
service: common
command: go run cmd/2_build_op-geth/main.go
networks:
- op-network


generate-keys:
build:
context: ./docker
dockerfile: Dockerfile.generate-keys
volumes:
- ./op-stack-deployer:/app
working_dir: /app
extends:
service: common
command: go run cmd/3_generate_keys/main.go
networks:
- op-network

Configure-network:
extends:
service: common
command: go run cmd/4_configure_network/main.go

deploy-l1-contracts:
build:
context: ./docker
dockerfile: Dockerfile.deploy-l1-contracts
volumes:
- ./op-stack-deployer:/app
working_dir: /app
extends:
service: common
command: go run cmd/5_deploy_L1_contracts/main.go
networks:
- op-network

l2-config:
build:
context: ./docker
dockerfile: Dockerfile.l2-config
volumes:
- ./op-stack-deployer:/app
working_dir: /app
extends:
service: common
command: sudo go run cmd/6_L2_config/main.go
networks:
- op-network

init-op-geth:
build:
context: ./docker
dockerfile: Dockerfile.init-op-geth
volumes:
- ./op-stack-deployer:/app
working_dir: /app
extends:
service: common
command: go run cmd/7_Initialize_op-geth/main.go
networks:
- op-network

run-op-geth:
build:
context: ./docker
dockerfile: Dockerfile.run-op-geth
volumes:
- ./op-stack-deployer:/app
working_dir: /app
extends:
service: common
command: go run cmd/8_run_op-geth/main.go
networks:
- op-network

run-op-node:
build:
context: ./docker
dockerfile: Dockerfile.run-op-node
volumes:
- ./op-stack-deployer:/app
working_dir: /app
command: go run cmd/9_run_op-node/main.go
networks:
- op-network
extends:
service: common
command: go run cmd/9_run_op-node/main.go

run-op-batcher:
build:
context: ./docker
dockerfile: Dockerfile.run-op-batcher
volumes:
- ./op-stack-deployer:/app
working_dir: /app
command: go run cmd/10_run_op-batcher/main.go
networks:
- op-network
extends:
service: common
command: go run cmd/10_run_op-batcher/main.go

run_op-proposer:
build:
context: ./docker
dockerfile: Dockerfile.run-op-proposer
volumes:
- ./op-stack-deployer:/app
working_dir: /app
run-op-proposer:
extends:
service: common
command: go run cmd/11_run_op-proposer/main.go
networks:
- op-network

get-rollup-address:
build:
context: ./docker
dockerfile: Dockerfile.get-rollup-address
volumes:
- ./op-stack-deployer:/app
working_dir: /app
command: go run cmd/12_get_rollup_address/main.go
networks:
- op-network

networks:
op-network:
op-network:
10 changes: 0 additions & 10 deletions docker/Dockerfile.build-op-geth

This file was deleted.

16 changes: 0 additions & 16 deletions docker/Dockerfile.build-optimism

This file was deleted.

10 changes: 0 additions & 10 deletions docker/Dockerfile.deploy-l1-contracts

This file was deleted.

10 changes: 0 additions & 10 deletions docker/Dockerfile.generate-keys

This file was deleted.

10 changes: 0 additions & 10 deletions docker/Dockerfile.get-rollup-address

This file was deleted.

10 changes: 0 additions & 10 deletions docker/Dockerfile.init-op-geth

This file was deleted.

10 changes: 0 additions & 10 deletions docker/Dockerfile.l2-config

This file was deleted.

73 changes: 73 additions & 0 deletions docker/Dockerfile.op-stack
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Common stage for shared instructions
FROM golang:alpine AS common

WORKDIR /app

COPY Dockerfile.op-stack /app/
COPY scripts/entrypoint-build-optimism.sh /app/
COPY cmd /app/
COPY go.mod /app/
COPY go.sum /app/

RUN apk update && apk add --no-cache git nodejs npm make jq direnv

# Stage 1: Build Optimism
FROM common AS build-optimism

RUN chmod +x /app/entrypoint-build-optimism.sh

CMD ["/app/entrypoint-build-optimism.sh"]

# Stage 2: Build op-geth
FROM common AS build-op-geth

COPY scripts/entrypoint-build-op-geth.sh /app/

RUN chmod +x /app/entrypoint-build-op-geth.sh

CMD ["/app/entrypoint-build-op-geth.sh"]

# Stage 3: Generate Keys
FROM common AS generate-keys

COPY scripts/entrypoint-generate-keys.sh /app/

RUN chmod +x /app/entrypoint-generate-keys.sh

CMD ["/app/entrypoint-generate-keys.sh"]

# Stage 4: Configure Network
FROM common AS configure-network

COPY scripts/entrypoint-configure-network.sh /app/

RUN chmod +x /app/entrypoint-configure-network.sh

CMD ["/app/entrypoint-configure-network.sh"]

# Stage 5: Deploy L1 Contracts
FROM common AS deploy-l1-contracts

COPY scripts/entrypoint-deploy-l1-contracts.sh /app/

RUN chmod +x /app/entrypoint-deploy-l1-contracts.sh

CMD ["/app/entrypoint-deploy-l1-contracts.sh"]

# Stage 6: Configure L2
FROM common AS configure-l2

COPY scripts/entrypoint-l2-config.sh /app/

RUN chmod +x /app/entrypoint-l2-config.sh

CMD ["/app/entrypoint-l2-config.sh"]

# Stage 7: Initialize op-geth
FROM common AS init-op-geth

COPY scripts/entrypoint-init-op-geth.sh /app/

RUN chmod +x /app/entrypoint-init-op-geth.sh

CMD ["/app/entrypoint-init-op-geth.sh"]
9 changes: 9 additions & 0 deletions docker/scripts/entrypoint-configure-network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

while [ ! -f /app/previous_step_done ]; do
sleep 1
done

go run cmd/4_configure_network/main.go

touch /app/configure_network_done
9 changes: 0 additions & 9 deletions docker/scripts/entrypoint-get-rollup-address.sh

This file was deleted.

0 comments on commit a9132fe

Please sign in to comment.