Skip to content

Commit

Permalink
Adding pm2 config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsommardahl committed Oct 23, 2024
1 parent 3b3fe34 commit 62aed32
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
13 changes: 13 additions & 0 deletions backend/src/server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
apps : [
{
name: "anyhasher",
script: "./server.js",
watch: true,
env: {
"PORT": 80,
"NODE_ENV": "production"
}
}
]
}
10 changes: 1 addition & 9 deletions util/ansible/roles/configure-server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,4 @@
name: pm2
global: yes
production: yes
state: present

- name: Set server PORT in environment
become: true
ansible.builtin.lineinfile:
dest: "/etc/environment"
state: present
regexp: "^PORT="
line: "PORT=80"
state: present
4 changes: 1 addition & 3 deletions util/ansible/roles/deploy-artifact/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
dest: ~/anyhasher

- name: Start Server
environment:
PORT: 80
shell: "cd ~/anyhasher/build && pm2 restart server.js"
shell: "cd ~/anyhasher/build && pm2 restart server.config.js"

- name: Verify Server
uri:
Expand Down

0 comments on commit 62aed32

Please # to comment.