https://github.com/alextanhongpin/phoenix-starter
Starter project with Phoenix, dockerized
https://github.com/alextanhongpin/phoenix-starter
elixir phoenix
Last synced: over 1 year ago
JSON representation
Starter project with Phoenix, dockerized
- Host: GitHub
- URL: https://github.com/alextanhongpin/phoenix-starter
- Owner: alextanhongpin
- Created: 2018-03-28T10:30:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T11:25:28.000Z (about 8 years ago)
- Last Synced: 2025-01-29T21:52:40.387Z (over 1 year ago)
- Topics: elixir, phoenix
- Language: Elixir
- Size: 2.45 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PhoenixStarter
To start your Phoenix server:
* Install dependencies with `mix deps.get`
* Create and migrate your database with `mix ecto.create && mix ecto.migrate`
* Install Node.js dependencies with `cd assets && npm install`
* Start Phoenix endpoint with `mix phx.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
Ready to run in production? Please [check our deployment guides](http://www.phoenixframework.org/docs/deployment).
## Learn more
* Official website: http://www.phoenixframework.org/
* Guides: http://phoenixframework.org/docs/overview
* Docs: https://hexdocs.pm/phoenix
* Mailing list: http://groups.google.com/group/phoenix-talk
* Source: https://github.com/phoenixframework/phoenix
## Start Postgres
```bash
$ docker-compose up -d
```
## Install Distillery
Create production release:
```bash
$ MIX_ENV=prod mix release
```
Run:
```bash
$ PORT=4000 _build/prod/rel/phoenix_starter/bin/phoenix_starter foreground
```
## Multi-stage docker build
```bash
$ make docker
```
Output:
```bash
$ docker images | grep phoenix
alextanhongpin/phoenix latest fff8456b5d82 53 seconds ago 77.2MB
```
## Set PORT
At `config/prod.exs`, set the following:
```
config :phoenix_starter, PhoenixStarterWeb.Endpoint,
# load_from_system_env: true,
# This is the port you want to connect to
# http: [port: {:system, "PORT"}],
http: [port: 4000],
url: [host: "example.com", port: 80],
# Must be true in production
server: true,
cache_static_manifest: "priv/static/cache_manifest.json"
```