platform/Dockerfile

38 lines
1.1 KiB
Docker
Raw Normal View History

2018-06-05 23:51:20 +00:00
FROM ubuntu:16.04
2017-01-15 00:15:20 +00:00
MAINTAINER Tobe O <thosakwe@gmail.com>
2018-06-05 23:51:20 +00:00
# Install Dart SDK.
2017-01-15 00:15:20 +00:00
RUN sudo apt-get update
2017-01-15 00:26:55 +00:00
RUN sudo apt-get install -y apt-transport-https
2017-01-15 00:37:26 +00:00
RUN sudo apt-get install -y curl
2017-01-15 00:15:20 +00:00
RUN sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
2018-06-05 23:51:20 +00:00
# Uncomment this for Dart 1.24.x
# RUN sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
# Comment this out if not installing Dart 2.x
RUN sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list'
2017-01-15 00:15:20 +00:00
RUN sudo apt-get update
2018-06-05 23:51:20 +00:00
RUN sudo apt-get install -y dart
2017-01-15 00:15:20 +00:00
RUN export PATH="/usr/lib/dart/bin:$PATH"
# Copy necessary files
ADD bin/ bin/
ADD config/ config/
ADD lib/ lib/
ADD tool/ tool/
2017-01-15 00:41:06 +00:00
ADD views/ views/
2017-01-15 00:15:20 +00:00
ADD web/ web/
ADD pubspec.yaml pubspec.yaml
# Install dependencies, pre-build
2017-01-15 00:42:06 +00:00
RUN /usr/lib/dart/bin/pub get
RUN /usr/lib/dart/bin/dart tool/build.dart
RUN /usr/lib/dart/bin/pub build
2017-01-15 00:15:20 +00:00
2017-10-19 22:02:11 +00:00
# Set environment, start server
2017-01-15 00:15:20 +00:00
ENV ANGEL_ENV=production
2017-01-15 00:25:33 +00:00
EXPOSE 3000
2017-01-15 00:42:06 +00:00
ENTRYPOINT ["/usr/lib/dart/bin/dart"]
2017-10-19 22:02:11 +00:00
CMD ["bin/prod.dart"]