Why not Docker for the playground?
MohammedAlSafwan opened this issue · comments
Describe the feature you'd like
I'm wondering why there is no dockerfile or a docker-compose.yml for this repo.
It would be nice to allow more new comers to hit one command and start the playground.
Describe alternatives you've considered
create a Dockerfile to host playground:
# Use the official Haskell image as the base image
FROM haskell:8.10
# Set the working directory
WORKDIR /app
# Clone the Plutus repository
RUN git clone https://github.com/input-output-hk/plutus.git /app/plutus
# Change the working directory to the Plutus repository
WORKDIR /app/plutus
# Checkout the specific commit or branch if necessary
# Replace "COMMIT_HASH" with the specific commit hash or "BRANCH_NAME" with the specific branch name
# RUN git checkout COMMIT_HASH
# RUN git checkout BRANCH_NAME
# Update Cabal
RUN cabal update
# Build the Plutus Playground server
RUN cabal build plutus-playground-server
# Build the Plutus Playground client
RUN cd plutus-playground-client \
&& npm install \
&& npm run build
# Expose the server port
EXPOSE 8080
# Start the Plutus Playground server
CMD ["cabal", "run", "plutus-playground-server", "--", "--node-server", "${CARDANO_NODE_HOST_URL}"]
create a docker-compose.yml to handle the playground and cardano-node:
version: "3.8"
services:
cardano-node:
container_name: cardano-node-${NETWORK:-preview}
image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-latest}
ports:
- ${CARDANO_NODE_PORT:-3001}:3001
volumes:
- node-db:/data/db
- node-ipc:/ipc
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
networks:
- playground-network
plutus-playground:
build:
context: .
dockerfile: Dockerfile
ports:
- 8080:8080
volumes:
- "plutus-data:/app/plutus"
environment:
- CARDANO_NODE_HOST_URL=http://cardano-node-${NETWORK:-preview}:${CARDANO_NODE_PORT:-3001}
networks:
- playground-network
volumes:
node-db:
node-ipc:
plutus-data:
networks:
playground-network:
wrong repo