-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
88 lines (57 loc) · 2.19 KB
/
Dockerfile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
## Train Pi Display
#base-image for node on any machine using a template var
FROM resin/%%RESIN_MACHINE_NAME%%-golang:latest
# Update to latest repo
RUN apt-get update
### Install wiringPi
#RUN apt-get install -y sudo python python-dev python-pip git libi2c-dev python-serial i2c-tools python-smbus
#RUN git clone https://github.com/WiringPi/WiringPi.git && cd WiringPi && ./build && echo "wiringPi Installed"
#RUN pip install RPi.GPIO
## Xorg packages
RUN apt-get install -y xorg xserver-xorg-video-fbdev fluxbox surf unclutter
RUN mkdir ~/.fluxbox
# Install node express and jade - install deps on build server, making sure to clean up the artifacts it creates in order to reduce the image size.
RUN apt-get install -y nodejs npm
#RUN npm install express jade
## Install Redis
RUN apt-get install -y redis-server
### Install php and composer for php
RUN apt-get -y install php5-cli curl cron
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN rm -rf /tmp/*
### Install golang packages
#RUN apt-get -y install golang mercurial git
#### Install vi during testing
RUN apt-get install -y vim
######################################
##### Uncachable lines from here #####
######################################
## Copy App files to container
COPY app /usr/src/app
#### Set up xorg config
RUN cp /usr/src/app/gui/xorg/* /usr/share/X11/xorg.conf.d/
### Set up fluxbox config
RUN cp /usr/src/app/gui/fluxbox/* ~/.fluxbox/
## Install node app
WORKDIR /usr/src/app/node
RUN npm install
#### Install server (php) app
WORKDIR /usr/src/app/server_php
RUN composer install
RUN touch /var/log/cron.log
#### Install go app
ENV MARTINI_ENV production
#ENV MARTINI_ENV testing
RUN mkdir -p /go/src/github.com/tomberthon
COPY app/api_go /go/src/github.com/tomberthon/train-alerts
#WORKDIR /opt/gocode/src/github.com/tomberthon/train-alerts
# Go build disabled as need go 1.5.2 to build on emulators - run in init.sh instead
#RUN go get
### Make app scripts executable
RUN chmod a+x /usr/src/app/*
## Tidy up node install cache and remove tmp files to keep image size small
RUN npm cache clean && rm -rf /tmp/*
RUN apt-get clean
## Cmd to start services
CMD /usr/src/app/init.sh