Skip to content

Commit

Permalink
Fix: change dev app port
Browse files Browse the repository at this point in the history
  • Loading branch information
jokj624 committed Dec 4, 2023
1 parent 3e553b4 commit 5f5262d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/develop_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
echo MONGODB_URI_DEV=${{ secrets.MONGODB_URI_DEV }} >> .env
echo MONGODB_URI_PROD=${{ secrets.MONGODB_URI_PROD }} >> .env
echo PORT=${{ secrets.PORT }} >> .env
echo DEV_PORT=${{ secret.DEV_PORT }} >> .env
echo DOCKERFILE=Dockerfile.dev >> .env
cat .env
Expand Down Expand Up @@ -76,8 +77,7 @@ jobs:
key: ${{ secrets.REMOTE_SSH_KEY }}
port: ${{ secrets.REMOTE_SSH_PORT }}
script: |
sudo su
/opt/havit/docker/deploy.sh dev
sudo /opt/havit/docker/deploy.sh dev
- name: action-slack
uses: 8398a7/action-slack@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RUN yarn

ADD . .

EXPOSE 8081
EXPOSE 8080

ENTRYPOINT ["cross-env", "NODE_ENV=development", "node", "dist"]
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ app.use(function (err, req, res, next) {
res.render('error');
});

const port =
process.env.NODE_ENV === 'dev' ? process.env.DEV_PORT : process.env.PORT;

app
.listen(process.env.PORT, () => {
.listen(port, () => {
console.log(`
################################################
🛡️ Server listening on port 🛡️
Expand Down

0 comments on commit 5f5262d

Please sign in to comment.