Services for the FreeFeed server development
The FreeFeed server development requires two additional network services: the PostgreSQL database and the Redis key-value store.
It is often not easy to install these services locally, especially on Windows. This repository will help you to create and run virtual machine (VM) with all necessary services installed and working.
Contents
- PostgreSQL 12 server
- Pre-created databases 'freefeed' and 'freefeed_test'
- Username/password are freefeed/freefeed
- Redis 5 server
- All working on Alpine Linux 3.12 virtual machine
Preparations
First you need to install Vagrant, the virtual machines management tool.
Second, you need to have some virtual machines provider. This repository supports the following providers: Oracle VirtualBox and Microsoft Hyper-V. It is up to you to choose which providers to use.
VirtualBox
It is probably the easiest way if you haven't already worked with virtual machines. You just need to install the Oracle VirtualBox.
Hyper-V
Hyper-V is included by default in Windows starting from 8.1 version (Enterprise, Pro, or Education only) but require to be enabled by user (see here and here).
Keep in mind that enabling Hyper-V will cause VirtualBox, VMware, and any other virtualization technology to no longer work. Hyper-V is also required for Docker. If you have Docker installed on your PC, you already have Hyper-V enabled.
Starting up
So when you made all preparations, download this repository to the separate folder and run the following command:
For VirtualBox provider:
vagrant up
For Hyper-V provider (⚠ run with admin rights):
vagrant up --provider=hyperv
The Vagrant will create and configure virtual machine with the PostgreSQL and Redis services.
To stop the machine use vagrant suspend
command, and to start it again use vagrant resume
or vagrant up
(you can omit --provider
flag if machine is already created). See Vagrant docs for more details.
Configuration
The VM has a separate private IP address on your host machine. You need this address to configure the FreeFeed server. Vagrant will show this address when machine starts. It is recommended to install small helper vagrant-address plugin: just type vagrant plugin install vagrant-address
. After the plugin installation, you will be able to view the VM IP address by command vagrant address
.
To set the FreeFeed server up, replace the "your.vm.ip.address"
strings in 'local.json' to the actual address of your VM and copy the 'local.json' file to the 'config' directory of FreeFeed server. This file will override the default locations of PostgreSQL and Redis.