forked from shmurata/docker-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 640 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 640 Bytes
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
FROM ubuntu:vivid
MAINTAINER Z Lab Corporation "opensource@zlab.co.jp"
RUN apt-get update \
&& apt-get -y install nodejs npm git \
&& apt-get clean
RUN update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
# Add group
ENV EXAMPLE_GROUP example
RUN groupadd -r $EXAMPLE_GROUP
# Add user
ENV EXAMPLE_USER example
ENV EXAMPLE_UID 3000
RUN useradd -r -u $EXAMPLE_UID -g $EXAMPLE_GROUP $EXAMPLE_USER
# Build application
RUN mkdir /opt/example
WORKDIR /opt
RUN git clone -b 0.1.0 https://github.com/zlabjp/example.git
WORKDIR /opt/example
RUN npm install
EXPOSE 4000
USER $EXAMPLE_USER
ENV PORT=4000
CMD [ "npm", "start"]