ED-NEWP / galos

0 stars 0 forks source link

Dockerized Service #1

Open nixpulvis opened 3 years ago

nixpulvis commented 3 years ago

@yevk has already written what can be the starting point for this here: https://github.com/M1K3SD1/BGS-Project/blob/main/docker/release-build.

We just need to install PostgreSQL/PostGIS as well, and other things will be mostly the same.

Error handling

We'll use the Docker restart policy for crashing containers: https://docs.docker.com/config/containers/start-containers-automatically/

yevk commented 3 years ago

We need:

nixpulvis commented 3 years ago

IDK if it makes sense to use Docker and systemd at the same time, but I've been using a little unit like this for my own server:

[Unit]
Description=An Elite: Dangerous Database and Service
Requires=postgresql.service
After=postgresql.service

[Service]
Type=simple
User=nixpulvis
WorkingDirectory=/home/nixpulvis/projects/galos
ExecStart=/home/nixpulvis/.cargo/bin/galos-sync eddn
Restart=always

[Install]
WantedBy=multi-user.target

Probably missing a few things to be perfect, but it at least saves my logs in the system journal, and manages running the thing. Would be nice to not have everything installed in my home directory as well :sweat_smile:

yevk commented 3 years ago

Docker does make sense. You're on Linux, I'm on macOS, AWS has its own images, and we don't know what future devs will be using.

yevk commented 3 years ago

This will begin when #8 is ready enough to be tested.

nixpulvis commented 3 years ago

There will probably be three services in the initial release of Galos:

  1. galos-sync eddn
  2. galos-worker
  3. galos-bot

This will begin when #8 is ready enough to be tested.

@yevk we should be running galos-sync as soon as possible now that we're not making backwards changes to the migrations. Then we can figure out how the bot will be fed information from the worker. However, for #8 I was assuming that we would just have a function call to cause the worker itself to issue a POST to Discord.

nixpulvis commented 3 years ago

I would consider this issue complete when the first service is up and running. If done well, future services should just be able to copy this template more or less.