Skip to content

Commit

Permalink
(+) Dockerfile and host on server
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazettt committed Jul 21, 2023
1 parent 2b968a9 commit 9607851
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:19-alpine

WORKDIR /app

COPY package.json .
COPY package-lock.json .

RUN npm install

COPY . .

EXPOSE 3012
CMD npm start
6 changes: 3 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"redirectUrl": "http://localhost:3000/",
"port": 3000
}
"redirectUrl": "https://bitly.mazettt.fr/",
"port": 3012
}
18 changes: 18 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if [[ $1 == "-h" ]]; then
echo "Use -b if you want to build the image before starting the app"
echo "Use -rm if you want to remove the running container"
exit 0
fi

if [[ $1 == "-rm" ]]; then
docker stop mazettt-bitly
docker rm mazettt-bitly
fi

if [[ $1 == "-b" ]]; then
docker build -t mazettt:bitly .
fi

docker run --name="mazettt-bitly" --restart=always -d -p 3012:3012 mazettt:bitly

0 comments on commit 9607851

Please sign in to comment.