This repository is meant for RC Tech Club application developers who wish to use Phoenix without on-the-fly Phoenix code development.
The docker containers that will be deployed are
- Postgres database
- Phoenix
- Ladybird
- Docker and Docker Compose
- Phoenix
Setup your environment variables. At this repo's root directory, run
cp .env.sample .envConfigure your developer configurations in the newly copied .env file to use services like AWS. Note that you have to obtain your unique IAM access key pairs, contact one of the club admins for this.
// .env
NODEMAILER_PASSWORD= // you can leave this blank, it is not critical
AWS_ACCESS_KEY_ID= // your iam access key id
AWS_SECRET_ACCESS_KEY= // your iam secret access key
Then run
docker-compose up -dAs a result, you should have:
Phoenix available at: http://localhost:4000
Ladybird available at: http://localhost:3001
Now, you are ready to start developing!
After you finish, remember to run
docker-compose downThis removes all the containers.
It is recommended to pull the latest images before spinning up the containers, especially if phoenix or ladybird images have been updated, and you want to use them.
docker compose pullYour containers can fail in several ways. Some common issues have been identified, and possible fixes are written here.
The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.2
This means the volume mounted by docker is based-off of an older version of postgres, while the postgres image being used is not compatible with that. Simply remove this docker volume.
docker volume rm development-setup_rctech-devA docker volume basically allows long term storage of postgres data, even after the postgres container is brought down, and removed.
All of Phoenix's rctechclub/phoenix docker images will run prisma migrate deploy to make sure that
- the
postgresdatabase is in-sync with the prisma schema - the
@prisma/clientis connected to the correct database on your local machine
If you want access to the database through prisma studio, go to the phoenix repository and run npx prisma studio. But make sure that the .env from this development-setup folder is copied over to phoenix.