Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frewacom/elixir-phoenix-docker-dev

Phoenix boilerplate using PostgreSQL, Docker, Typescript, ESLint and prettier
https://github.com/frewacom/elixir-phoenix-docker-dev

boilerplate docker docker-container elixir elixir-phoenix eslint postgresql-database prettier template-repository typescript

Last synced: about 2 months ago
JSON representation

Phoenix boilerplate using PostgreSQL, Docker, Typescript, ESLint and prettier

Awesome Lists containing this project

README

        

# Elixir and Phoenix boilerplate
Boilerplate for a Phoenix application with a PostgreSQL database. Runs in a
docker container for easy setup and development.

## Features
* Docker
* Typescript
* Eslint
* Prettier

## Setup
> Depending on your installation, you might need to add `sudo` before each docker commmand.

1. Install docker
* [Docker](https://docs.docker.com/get-started/)
* [Docker compose](https://docs.docker.com/compose/)
2. Make sure that docker is running (run the appropriate command for your system):
```
$ systemctl start docker
```
3. Build the docker container:
```
$ docker-compose build
```
4. Start the container to install Elixir dependencies
```
$ docker-compose up
```
5. Stop the container and create the PostgreSQL database:
```
$ docker-compose run web mix ecto.create
```
6. Start the container again:
```
$ docker-compose up
```
6. Navigate to:
```
localhost:4000
```

## Commands
* `npm run docker:shell` - opens an interactive shell in the docker container
* `npm run docker:migrate` - starts a migration of the database using Ecto
* `npm run docker:dev` - starts the docker container
* `npm run docker:start` - starts the docker container in the background
* `npm run docker:stop` - stops all running docker containers
* `npm run tsc:dev` - watches for changes to source files and reports errors
* `npm run tsc:lint` - lints all source files in `/src`
* `npm run tsc:format` - formats all source files in `/src` using prettier
* `npm run util:rename ` - rename the phoenix application, [usage docs](https://github.com/MainShayne233/rename)