forked from home-assistant/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review Docker management ( linked with home-assistant#934 )
- Loading branch information
Showing
6 changed files
with
104 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
FROM node:8.2.1-alpine | ||
FROM node:8.9 | ||
|
||
# install yarn | ||
ENV PATH /root/.yarn/bin:$PATH | ||
|
||
RUN apk update \ | ||
&& apk add curl bash binutils tar git python3 \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& /bin/bash \ | ||
&& touch ~/.bashrc \ | ||
&& curl -o- -L https://yarnpkg.com/install.sh | bash | ||
RUN apt-get update \ | ||
&& apt-get install -y curl bash binutils tar git python3 locales \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
dpkg-reconfigure --frontend=noninteractive locales && \ | ||
update-locale LANG=en_US.UTF-8 | ||
|
||
ENV LANG en_US.UTF-8 | ||
|
||
RUN curl -o- -L https://yarnpkg.com/install.sh | bash | ||
|
||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 \ | ||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2 | ||
|
||
RUN mkdir -p /frontend | ||
WORKDIR /frontend | ||
|
||
ENV NODE_ENV production | ||
WORKDIR /frontend | ||
|
||
COPY package.json ./ | ||
RUN yarn | ||
|
||
RUN yarn install | ||
|
||
COPY bower.json ./ | ||
RUN ./node_modules/.bin/bower install --allow-root | ||
|
||
RUN node_modules/.bin/bower install --allow-root | ||
|
||
COPY . . | ||
CMD [ "/bin/bash", "./script/build_frontend" ] | ||
|
||
COPY script/docker_entrypoint.sh /usr/bin/docker_entrypoint.sh | ||
|
||
|
||
|
||
RUN chmod +x /usr/bin/docker_entrypoint.sh | ||
|
||
CMD [ "docker_entrypoint.sh" ] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
# Building the basic image for compiling the production frontend | ||
|
||
IMAGE_NAME=home_assistant_fe_image | ||
IMAGE_TAG=latest | ||
|
||
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# Docker entry point inspired by travis build and script/build_frontend | ||
|
||
# Stop on errors | ||
set -e | ||
|
||
# Build the frontend but not used the npm run build | ||
/bin/bash script/build_frontend | ||
|
||
# TEST | ||
npm run test | ||
|
||
# | ||
#xvfb-run wct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
# Execute interactive bash on basic image | ||
|
||
IMAGE_NAME=home_assistant_fe_image | ||
IMAGE_TAG=latest | ||
|
||
docker run -it \ | ||
-v $PWD/:/frontend/ \ | ||
-v /frontend/node_modules \ | ||
-v /frontend/bower_components \ | ||
${IMAGE_NAME}:${IMAGE_TAG} /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
# Execute the basic image for compiling the production frontend | ||
|
||
IMAGE_NAME=home_assistant_fe_image | ||
IMAGE_TAG=latest | ||
|
||
docker run -it \ | ||
-v $PWD/:/frontend/ \ | ||
-v /frontend/node_modules \ | ||
-v /frontend/bower_components \ | ||
${IMAGE_NAME}:${IMAGE_TAG} /bin/bash script/build_frontend |