-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (54 loc) · 1.58 KB
/
Dockerfile
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
FROM clojure
ENV APP_HOME=/app
WORKDIR ${APP_HOME}
# Default application settings
ENV JIKSNU_DB_HOST=mongo
ENV HTTP_PORT=8080
# Expose HTTP port
EXPOSE 8080
# Expose nRepl port
EXPOSE 7888
# Expose Karma port
EXPOSE 9876
# Expose Karma Live HTTP reporter
EXPOSE 5060
# Install dependencies
RUN set -x \
&& curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y \
byobu \
build-essential \
curl \
git \
jq \
netcat \
nodejs \
yarn \
&& rm -rf /var/lib/apt/lists/*
### Add notify-send proxy
RUN set -x \
&& curl -sL https://github.com/fgrehm/notify-send-http/releases/download/v0.2.0/client-linux_amd64 > /usr/bin/notify-send \
&& chmod +x /usr/bin/notify-send
### Create application user
ARG user=jiksnu
ARG group=jiksnu
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group} \
&& useradd -u ${uid} -g ${gid} --create-home -s /bin/bash ${user} \
&& su ${user} -c "byobu-ctrl-a screen"
# Add base project files
COPY script/gather-dependencies ${APP_HOME}/script/gather-dependencies
COPY package.json project.clj .yarnclean yarn.lock ${APP_HOME}/
RUN script/gather-dependencies
### Add application
COPY . ${APP_HOME}/
RUN script/bootstrap \
&& mv /root/.m2 /home/${user}/ \
&& chown -R ${uid}:${gid} ${APP_HOME} /home/${user}/.m2
USER ${user}
ENTRYPOINT []
CMD [ "script/entrypoint-run-dev" ]