add dockerfile for gimlet-cocktail µservices
This commit is contained in:
parent
f12b86d8ae
commit
ddae18f698
|
@ -0,0 +1,25 @@
|
|||
FROM flitter/init
|
||||
MAINTAINER Xena <xena@yolo-swag.com>
|
||||
|
||||
RUN apt-get update &&\
|
||||
apt-get -y install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make curl git-core luarocks &&\
|
||||
luarocks install moonrocks --server=http://rocks.moonscript.org &&\
|
||||
moonrocks install gimlet-cocktail &&\
|
||||
moonrocks install moonscript &&\
|
||||
moonrocks install yaml &&\
|
||||
moonrocks install xavante &&\
|
||||
moonrocks install wsapi &&\
|
||||
moonrocks install wsapi-xavante
|
||||
|
||||
ADD prepare.moon /app/prepare.moon
|
||||
ADD gimlet /etc/service/gimlet/run
|
||||
ENTRYPOINT /sbin/my_init
|
||||
|
||||
ENV PORT 5000
|
||||
EXPOSE 5000
|
||||
ENV ENVIRONMENT docker
|
||||
|
||||
ONBUILD ADD app.yaml /app/
|
||||
ONBUILD RUN moon /app/prepare.moon /app/app.yaml
|
||||
ONBUILD ADD . /app/src
|
||||
ONBUILD RUN moonc /app/src
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /app/src
|
||||
|
||||
gimlet -x app
|
|
@ -0,0 +1,35 @@
|
|||
yaml = require "yaml"
|
||||
|
||||
manifest_path = ...
|
||||
|
||||
error "Missing manifest_path" if not manifest_path
|
||||
|
||||
strip = (str) -> str\match "^%s*(.-)%s*$"
|
||||
|
||||
read_cmd = (cmd) ->
|
||||
f = io.popen cmd, "r"
|
||||
with strip f\read"*a"
|
||||
assert f\close!
|
||||
|
||||
fin = io.open manifest_path, "r"
|
||||
app = yaml.load fin\read "*a"
|
||||
fin\close!
|
||||
|
||||
if app.overlay
|
||||
print "writing overlay for #{app.name or "this application"}"
|
||||
|
||||
for step, command in pairs app.overlay
|
||||
f = io.popen command, "r"
|
||||
for line in f\lines!
|
||||
print "#{step} -- #{line}"
|
||||
|
||||
assert f\close!
|
||||
|
||||
if app.dependencies
|
||||
print "installing dependencies for #{app.name or "this application"}..."
|
||||
|
||||
for _, dep in pairs app.dependencies
|
||||
print "installing dependency #{dep}"
|
||||
read_cmd "moonrocks install #{dep}"
|
||||
|
||||
print "done!"
|
Loading…
Reference in New Issue