Asd22 Entertainment commited on
Commit ·
10d5116
1
Parent(s): 64caac7
trying to build
Browse files- Dockerfile +3 -12
- bin/main.dart +2 -4
- pubspec.lock +2 -2
- pubspec.yaml +1 -1
Dockerfile
CHANGED
|
@@ -1,16 +1,7 @@
|
|
| 1 |
-
FROM
|
| 2 |
-
RUN apt-get update && apt-get install -y \
|
| 3 |
-
wget \
|
| 4 |
-
unzip \
|
| 5 |
-
libssl-dev \
|
| 6 |
-
&& apt-get clean
|
| 7 |
-
RUN wget -O /tmp/dart-sdk.zip https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip \
|
| 8 |
-
&& unzip /tmp/dart-sdk.zip -d /usr/lib \
|
| 9 |
-
&& rm /tmp/dart-sdk.zip
|
| 10 |
-
ENV PATH="/usr/lib/dart-sdk/bin:$PATH"
|
| 11 |
WORKDIR /app
|
| 12 |
COPY . .
|
| 13 |
RUN dart pub get
|
| 14 |
-
RUN
|
| 15 |
EXPOSE 8080
|
| 16 |
-
CMD ["
|
|
|
|
| 1 |
+
FROM dart:stable AS build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
WORKDIR /app
|
| 3 |
COPY . .
|
| 4 |
RUN dart pub get
|
| 5 |
+
RUN dart compile exe bin/main.dart -o bin/server
|
| 6 |
EXPOSE 8080
|
| 7 |
+
CMD ["./bin/server"]
|
bin/main.dart
CHANGED
|
@@ -1,13 +1,11 @@
|
|
| 1 |
-
import 'dart:io';
|
| 2 |
import 'package:dartcore/dartcore.dart' as dartcore;
|
| 3 |
|
| 4 |
final app = dartcore.App();
|
| 5 |
|
| 6 |
void main() async {
|
| 7 |
-
|
| 8 |
-
app.route("GET", "/", (req, res) async {
|
| 9 |
res.html("<h1>Hello World</h1>");
|
| 10 |
});
|
| 11 |
|
| 12 |
-
await app.start();
|
| 13 |
}
|
|
|
|
|
|
|
| 1 |
import 'package:dartcore/dartcore.dart' as dartcore;
|
| 2 |
|
| 3 |
final app = dartcore.App();
|
| 4 |
|
| 5 |
void main() async {
|
| 6 |
+
app.get("/", (req, res) async {
|
|
|
|
| 7 |
res.html("<h1>Hello World</h1>");
|
| 8 |
});
|
| 9 |
|
| 10 |
+
await app.start(port: 8080);
|
| 11 |
}
|
pubspec.lock
CHANGED
|
@@ -122,10 +122,10 @@ packages:
|
|
| 122 |
dependency: "direct main"
|
| 123 |
description:
|
| 124 |
name: dartcore
|
| 125 |
-
sha256:
|
| 126 |
url: "https://pub.dev"
|
| 127 |
source: hosted
|
| 128 |
-
version: "0.0.
|
| 129 |
dio:
|
| 130 |
dependency: transitive
|
| 131 |
description:
|
|
|
|
| 122 |
dependency: "direct main"
|
| 123 |
description:
|
| 124 |
name: dartcore
|
| 125 |
+
sha256: "967777a5ff9db4762b816a27f86f6d400381b55ccce5f918938c9ad6db74a86b"
|
| 126 |
url: "https://pub.dev"
|
| 127 |
source: hosted
|
| 128 |
+
version: "0.0.7"
|
| 129 |
dio:
|
| 130 |
dependency: transitive
|
| 131 |
description:
|
pubspec.yaml
CHANGED
|
@@ -8,7 +8,7 @@ environment:
|
|
| 8 |
|
| 9 |
# Add regular dependencies here.
|
| 10 |
dependencies:
|
| 11 |
-
dartcore: ^0.0.
|
| 12 |
# path: ^1.8.0
|
| 13 |
|
| 14 |
dev_dependencies:
|
|
|
|
| 8 |
|
| 9 |
# Add regular dependencies here.
|
| 10 |
dependencies:
|
| 11 |
+
dartcore: ^0.0.7
|
| 12 |
# path: ^1.8.0
|
| 13 |
|
| 14 |
dev_dependencies:
|