-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from Lucas-C/ajout_dockerfile
Ajout Dockerfile & publication sur Docker hub
- Loading branch information
Showing
6 changed files
with
53 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/.git/ | ||
/node_modules/ | ||
/src/app/bower_components/ | ||
/Dockerfile |
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
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o pipefail -o errexit -o nounset | ||
|
||
# Build a docker image and push it to docker hub (only when it's not a pull request) | ||
if [ "$DOCKER_USER" != "" ] && [ "$DOCKER_PASS" != "" ]; then | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH | sed -e 's/\//_/g' -e 's/\#//g' -e 's/\-/_/g' ; fi` | ||
docker build -t hesperides/hesperides-gui:$TAG --label git_commit=$COMMIT . | ||
docker push hesperides/hesperides-gui:$TAG | ||
echo "✓ Docker image build and pushed to docker hub" | ||
else | ||
echo '✗ Missing $DOCKER_USER or $DOCKER_PASS environment variable' | ||
fi |
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 @@ | ||
FROM node:8-alpine | ||
WORKDIR /usr/src/app | ||
RUN echo '{"allow_root": true}' > /root/.bowerrc | ||
RUN apk add git | ||
COPY . . | ||
RUN npm install | ||
RUN npm run postinstall | ||
|
||
FROM nginx:1.15-alpine | ||
COPY --from=0 /usr/src/app/src/app /usr/share/nginx/html/ | ||
COPY --from=0 /usr/src/app/src/app/img/favicon.ico /usr/share/nginx/html/ |
This file was deleted.
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