write docker config
This commit is contained in:
parent
c784db1d15
commit
d8cab30a5b
14
Dockerfile
14
Dockerfile
@ -1,14 +0,0 @@
|
|||||||
FROM node:13.14.0-alpine3.10
|
|
||||||
WORKDIR /home/app/app
|
|
||||||
COPY build public
|
|
||||||
COPY ./server.js ./server.js
|
|
||||||
COPY ./server.package.json ./package.json
|
|
||||||
ENV PORT=8000
|
|
||||||
|
|
||||||
RUN npm install express
|
|
||||||
|
|
||||||
CMD npm run start
|
|
||||||
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
|
|
20
dockers/Dockerfile
Normal file
20
dockers/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Use Image Node Alpine For Build
|
||||||
|
FROM node:13.14.0-alpine3.10
|
||||||
|
|
||||||
|
# Default Working Directory
|
||||||
|
WORKDIR /home/app/app
|
||||||
|
|
||||||
|
# Copy Build Directory To Public Directory in Docker
|
||||||
|
COPY build public
|
||||||
|
|
||||||
|
# Copy server.js To server , we open server from here
|
||||||
|
COPY ./dockers/server.js ./server.js
|
||||||
|
|
||||||
|
# Copy package.json for server to docker package json
|
||||||
|
COPY ./dockers/server.package.json ./package.json
|
||||||
|
|
||||||
|
# install express , for open server
|
||||||
|
RUN npm install express
|
||||||
|
|
||||||
|
|
||||||
|
|
54
hooks.sh
Normal file
54
hooks.sh
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo $PWD
|
||||||
|
|
||||||
|
while read oldrev newrev ref
|
||||||
|
do
|
||||||
|
CURRENT_BRANCH=`echo $ref | cut -d/ -f3`
|
||||||
|
done
|
||||||
|
|
||||||
|
TARGET="/home/git/pub/test_react_hook"
|
||||||
|
TEMP="/home/git/tmp/test_react_hook"
|
||||||
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
HEROKU_APP_NAME="react-host-test"
|
||||||
|
API_KEY=d282975b-22ba-48f1-9bbe-a1a22bec5543
|
||||||
|
|
||||||
|
|
||||||
|
echo "Current Branch : $CURRENT_BRANCH"
|
||||||
|
|
||||||
|
if [ CURRENT_BRANCH != "publish" ]
|
||||||
|
then
|
||||||
|
echo "Not Publish"
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
REPO="$PWD/test_react_hook.git"
|
||||||
|
mkdir -p $TEMP
|
||||||
|
git --work-tree=$TEMP --git-dir=$REPO checkout -f
|
||||||
|
cd $TEMP
|
||||||
|
|
||||||
|
|
||||||
|
echo "Start Install Project Dependencies"
|
||||||
|
yarn install
|
||||||
|
|
||||||
|
echo "Start Building Project"
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
echo "Push Project To Heroku"
|
||||||
|
|
||||||
|
echo "-- Start Login Heroku Containers Registry"
|
||||||
|
HEROKU_API_KEY=$API_KEY heroku container:login
|
||||||
|
|
||||||
|
echo "-- Start Push App To Heroku"
|
||||||
|
HEROKU_API_KEY=$API_KEY heroku container:push -a $HEROKU_APP_NAME web
|
||||||
|
|
||||||
|
echo "-- Start Release App on Heroku"
|
||||||
|
HEROKU_API_KEY=$API_KEY heroku container:release -a $HEROKU_APP_NAME web
|
||||||
|
|
||||||
|
echo "-- Infomation "
|
||||||
|
HEROKU_API_KEY=$API_KEY heroku apps:info -a $HEROKU_APP_NAME
|
||||||
|
|
||||||
|
rm -rf $TEMP
|
Loading…
Reference in New Issue
Block a user