forked from saqkhan1995/Vue-BookListing-Part-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (37 loc) · 1.31 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
FROM codeschool/projects-cli:${PROJECTS_CLI_BUILD_TAG:-latest} as projects-cli
FROM ubuntu
SHELL ["/bin/bash", "-c"]
WORKDIR /opt/
RUN mkdir -p /opt/cache/Vue-BookListing-Forms/
ADD package.json .nvmrc /opt/cache/Vue-BookListing-Forms/
RUN apt-get update \
&& chmod -R 777 * \
&& apt-get -y install curl git bsdtar
# Create a psprojects user to default the running container to
RUN \
useradd -b /opt -c "psprojects" -M psprojects && \
chown -R psprojects:psprojects /opt && \
mkdir -p /home/psprojects && \
chown -R psprojects:psprojects /home/psprojects
ENV HOME=/home/psprojects
USER psprojects
# copy the projects-cli from it's container image.
COPY --from=projects-cli /opt/projects-cli /opt/projects-cli
# setup nvm
RUN \
mkdir -p ~/ && \
touch ~/.bash_profile && \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && \
source ~/.bash_profile && \
nvm install $(cat /opt/projects-cli/.nvmrc) && \
nvm alias default $(cat /opt/projects-cli/.nvmrc) && \
cp ~/.bash_profile ~/.bashrc && \
cp ~/.bash_profile ~/.profile && \
pushd /opt/projects-cli/ && \
npm install && \
popd && \
pushd /opt/cache/Vue-BookListing-Forms/ && \
source ~/.bash_profile && nvm install && \
source ~/.bash_profile && nvm use && npm install && \
popd && \
nvm use default