forked from qiniu/builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (33 loc) · 1.48 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
FROM node:8.16.1
LABEL maintainer="nighca@live.cn"
WORKDIR /fec
# provide yarn for user
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
echo "deb http://deb.debian.org/debian/ jessie main" >/etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian/ jessie main" >>/etc/apt/sources.list && \
echo "deb http://security.debian.org/ jessie/updates main" >>/etc/apt/sources.list && \
echo "deb-src http://security.debian.org/ jessie/updates main" >>/etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian jessie-backports main" >>/etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian jessie-backports main" >>/etc/apt/sources.list && \
echo "Acquire::Check-Valid-Until "false";" >>/etc/apt/apt.conf
# install yarn (https://yarnpkg.com/en/docs/install#linux-tab)
RUN apt-get update && apt-get install -y apt-transport-https
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
RUN cd /fec
# copy config files & install dependencies
COPY ./package.json ./
COPY ./npm-shrinkwrap.json ./
RUN npm install
# expose port
EXPOSE 80
# copy other files
COPY ./bin ./bin
COPY ./lib ./lib
COPY ./preset-configs ./preset-configs
COPY ./cmd.sh ./cmd.sh
# use bash instead of sh to support usage of source
RUN rm /bin/sh && ln -sf /bin/bash /bin/sh
# run script
CMD ["/fec/cmd.sh"]