Skip to content

Commit

Permalink
fix: change start service and add dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ali1ariel committed Nov 30, 2024
1 parent 6e18e43 commit eaa10c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ defmodule DigistabStore.MixProject do
{:dns_cluster, "~> 0.1.1"},
{:bandit, "~> 1.5"},
{:phoenix_html_helpers, "~> 1.0"},
{:money, "~> 1.12"}
{:money, "~> 1.12"},
{:hackney, "~> 1.9"}
]
end

Expand Down
12 changes: 6 additions & 6 deletions scripts/start_application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ KEY_BASE=$(aws ssm get-parameter --name "/digistab_store/prod/secret_key_base" -


echo "Setting up directory permissions..."
mkdir -p /opt/digistab_store/_build/prod/rel/digistab_store/tmp
chown -R ubuntu:ubuntu /opt/digistab_store/_build/prod/rel/digistab_store/tmp
chmod -R 755 /opt/digistab_store/_build/prod/rel/digistab_store/tmp
sudo mkdir -p /opt/digistab_store/_build/prod/rel/digistab_store/tmp
sudo chown -R ubuntu:ubuntu /opt/digistab_store/_build/prod/rel/digistab_store/tmp
sudo chmod -R 755 /opt/digistab_store/_build/prod/rel/digistab_store/tmp

echo "Creating systemd service file..."
sudo tee /etc/systemd/system/digistab_store.service > /dev/null << EOL
Expand All @@ -19,7 +19,7 @@ Description=Digistab Store Phoenix Application
After=network.target postgresql.service
[Service]
Type=forking
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/opt/digistab_store
Expand All @@ -34,7 +34,7 @@ Environment=RELEASE_NAME=digistab_store
Environment=DATABASE_URL=${DB_URL}
Environment=SECRET_KEY_BASE=${KEY_BASE}
ExecStart=/opt/digistab_store/_build/prod/rel/digistab_store/bin/digistab_store daemon
ExecStart=/opt/digistab_store/_build/prod/rel/digistab_store/bin/digistab_store start
ExecStop=/opt/digistab_store/_build/prod/rel/digistab_store/bin/digistab_store stop
Restart=always
RestartSec=5
Expand All @@ -43,7 +43,7 @@ RestartSec=5
WantedBy=multi-user.target
EOL

echo "Setting proper permissions for service file..."
echo "Setting proper permissions..."
sudo chmod 644 /etc/systemd/system/digistab_store.service

echo "Downloading RDS certificate if needed..."
Expand Down

0 comments on commit eaa10c0

Please sign in to comment.