Skip to content

Instantly share code, notes, and snippets.

@graphicbeacon
Created May 17, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graphicbeacon/9de4ebbde10262969bbe811825ee934f to your computer and use it in GitHub Desktop.
Save graphicbeacon/9de4ebbde10262969bbe811825ee934f to your computer and use it in GitHub Desktop.
Setup Dart with Docker
# ./Dockerfile
FROM google/dart-runtime
// ./bin/server.dart
import 'dart:io';
main() async {
var port = int.parse(Platform.environment['PORT'] ?? '4567');
var server = await HttpServer.bind(InternetAddress.anyIPv4, port);
print('Server listening at port $port');
await for (HttpRequest request in server) {
request.response
..write('Hello, World!')
..close();
}
}
@andreipa
Copy link

Error missing the pubspec.yaml
Is it possible to create using docker-compose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment