A minimalistic website to store and view my favourite poems. https://poems.xirion.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Victor Roest 67814d339f
Update deps
2 years ago
config added tests 2 years ago
docs Docs and better dockerfile 2 years ago
k8s Prometheus exporter 2 years ago
lib Initial translator implementation 2 years ago
priv Make poems flexboxes 2 years ago
rel Add peerage 2 years ago
test Add tests 2 years ago
.credo.exs added search 2 years ago
.dockerignore Added dockerimage 2 years ago
.drone.yaml Update deps 2 years ago
.formatter.exs Initial commit 2 years ago
.gitattributes Add favicon 2 years ago
.gitignore Added basic auth 2 years ago
.iex.exs Minor changes 2 years ago
Dockerfile Update deps 2 years ago
README.md Docs and better dockerfile 2 years ago
docker-compose.yaml Add docker-compose 2 years ago
mix.exs Updated Dependencies and wrap pre 2 years ago
mix.lock Update deps 2 years ago

README.md

Poems

A minimalistic website to store and view my favourite poems.

An online version is hosted at https://poems.xirion.net/

For screenshots see screenshots.md

Development

Requirements:

  • Docker (Optional, but very useful)
  • Elixir and mix

To run dps in dev mode:

docker-compose up -d db # Start local postgres db inside a docker container
mix.ecto.reset     # Migrate and seed the database
mix phx.server     # Start the live reload server

For running the tests simply do

# Start db if it isn't running already
docker-compose up -d db

# Run tests
mix test

Deployment

Some notes on how to deploy The application.

For deploying on k8s the files in k8s give an example of how to do so.

Make sure to set the FQDNs and the env vars correctly.

Docker deployment

To deploy in docker you can use docker-compose.yml like so.

# Build the container
docker build . -t dps

# Start the docker-compose db
docker-compose up -d db

# Setup schema
mix ecto.reset

# Start dps itself
docker-compose up -d dps

# Verify its working
curl localhost:4000

Running locally

To run the application locally in release mode do the following:

# Generate static digests (make sure to not commit these)
mix phx.digest

# Build the release
MIX_ENV=prod mix release

# Ensure database is populated
mix ecto.reset

# Run the program with correct parameters
DATABASE_URL=ecto://postgres:postgres@localhost/dps_prod \
RELEASE_COOKIE=secret-cookie \
SECRET_KEY_BASE=kZ3O750w/sd7CcXO9053xWGTlOW3dYtLORLiYKqOL25UwboP/TJZz5g+YhOVLzOy \
HOSTNAME=127.0.0.1 \
SERVICE_NAME=localhost.svc \
APP_HOST=localhost \
APP_PORT=4000      \
AUTH_USERNAME=user \
AUTH_PASSWORD=pass \
PORT=4000 \
_build/prod/rel/dps/bin/dps start

Deployment References