Updating the containers

If I, or someone else makes changes to the repository, this creates a new docker image for the website. Currently, for the private server GitHub actions does not allow me to ssh into the server to continously deploy the website. For a public server, I will consider doing this later.

So, right now only the docker image gets created and gets uploaded to dockerhub automatically, and after that we need to manually deploy the server.

Assuming that the containers are already running, here are a list of commands that will allow the deployment of the website:

  1. Stop the .service file for the container that you want to stop.
systemctl --user stop nyush_exchange_backend.service
# podman stop nyush_exchange_backend won't work because
# the .service file will immediately start the container again.
  1. Delete the container.
 podman rm nyush_exchange_backend
  1. Pull the new docker image from dockerhub, or some other website:
podman pull docker.io/minjae07206/nyush_exchange_platform_backend:latest
  1. Create the container again
podman create   --name nyush_exchange_backend   --network my-network   --env-file /home/ml6722/.env   -p 3389:3389   -v /var/www/uploads:/nyush_exchange_platform_server/var/www/uploads   minjae07206/nyush_exchange_platform_backend:latest
  1. Start the .service file
systemctl --user start nyush_exchange_backend.service

Debugging

Some things you can do to check for what is going on inside the containers.

podman logs nyush_exchange_backend # shows the backend code's console.log()
podman ps -a # lists all the containers that currently exist in the server, and their states.