Skip to content

liudonghua123/dart-pad-docker

Repository files navigation

dart-pad-docker

What is it

This is a simple docker project which build a own dart-pad services.

How to use it

The quick way to start up is using nginx-proxy with docker-compose. You need to expose two endpont: one for the front-end, one for the back-end. So replace <...> in the following docker-compose.yml.

version: "3.7"

services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro

  dart-pad:
    build:
      context: .
      dockerfile: dockerfiles/Dockerfile-dart-pad
    image: liudonghua123/dart-pad
    networks:
      - nginx-proxy
    environment:
      - VIRTUAL_HOST=<dart-pad-front-end-host-or-domain>
    entrypoint: bash -c "cd /dart-pad && DARTPAD_BACKEND=<http://dart-pad-back-end-host-or-domain> grind serve-custom-backend"

  dart-services:
    build:
      context: .
      dockerfile: dockerfiles/Dockerfile-dart-services
    image: liudonghua123/dart-services
    networks:
      - nginx-proxy
    environment:
      - VIRTUAL_HOST=<dart-pad-back-end-host-or-domain>

networks:
  nginx-proxy:
    external:
      name: nginx-proxy-default

Updated: You can use standalone version of dart-pad NOW, see docker-compose-standalone.yml.sample for more details. In this way, you can only expose ONE endpoint which is <dart-pad-host-or-domain> in the following docker-compose.yml.

version: "3.7"
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro

  dart-pad-standalone:
    build:
      context: .
      dockerfile: dockerfiles/Dockerfile-dart-pad-standalone
    image: liudonghua123/dart-pad-standalone
    environment:
      - VIRTUAL_HOST=<dart-pad-host-or-domain>
    depends_on:
      - dart-services
    networks:
      - nginx-proxy

  dart-services:
    image: liudonghua123/dart-services
    networks:
      - nginx-proxy

networks:
  nginx-proxy:
    external:
      name: nginx-proxy-default

Updated: You can use extended version of dart-services which support customize the default installed packages for dart/flutter NOW. Just ONLY replace liudonghua123/dart-services with liudonghua123/dart-services-extended. You can see dockerfiles/Dockerfile-services-extended how I did it. And you can modified the your customized default packages according to make flutter example change commit.

snapshots

Next work

  • Add README.md for documentation.
  • Rewrite to only expose ONE endpoint.
  • Customize the default installed packages for dart/flutter.
  • Improve the customization default packages process.

License

MIT License

Copyright (c) 2021 liudonghua

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages