Skip to content

Commit be6d65a

Browse files
committed
Code for step 1
0 parents  commit be6d65a

34 files changed

+777
-0
lines changed

.formatter.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
import_deps: [:phoenix],
3+
inputs: ["*.{ex,exs}", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
docker_elixir_19_release-*.tar
24+
25+
# Since we are building assets from assets/,
26+
# we ignore priv/static. You may want to comment
27+
# this depending on your deployment strategy.
28+
/priv/static/

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
elixir 1.9.0-rc.0

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# DockerElixir19Release
2+
3+
To start your Phoenix server:
4+
5+
* Install dependencies with `mix deps.get`
6+
* Start Phoenix endpoint with `mix phx.server`
7+
8+
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
9+
10+
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
11+
12+
## Learn more
13+
14+
* Official website: http://www.phoenixframework.org/
15+
* Guides: https://hexdocs.pm/phoenix/overview.html
16+
* Docs: https://hexdocs.pm/phoenix
17+
* Mailing list: http://groups.google.com/group/phoenix-talk
18+
* Source: https://github.com/phoenixframework/phoenix

config/config.exs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file is responsible for configuring your application
2+
# and its dependencies with the aid of the Mix.Config module.
3+
#
4+
# This configuration file is loaded before any dependency and
5+
# is restricted to this project.
6+
7+
# General application configuration
8+
use Mix.Config
9+
10+
# Configures the endpoint
11+
config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
12+
url: [host: "localhost"],
13+
secret_key_base: "6Alpv/H1mEDDJAEarC1QwZ2mIqXZXEhpERpfP80YU6m0N16mxAd73taFlBYaSU5K",
14+
render_errors: [view: DockerElixir19ReleaseWeb.ErrorView, accepts: ~w(html json)],
15+
pubsub: [name: DockerElixir19Release.PubSub, adapter: Phoenix.PubSub.PG2]
16+
17+
# Configures Elixir's Logger
18+
config :logger, :console,
19+
format: "$time $metadata[$level] $message\n",
20+
metadata: [:request_id]
21+
22+
# Use Jason for JSON parsing in Phoenix
23+
config :phoenix, :json_library, Jason
24+
25+
# Import environment specific config. This must remain at the bottom
26+
# of this file so it overrides the configuration defined above.
27+
import_config "#{Mix.env()}.exs"

config/dev.exs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
use Mix.Config
2+
3+
# For development, we disable any cache and enable
4+
# debugging and code reloading.
5+
#
6+
# The watchers configuration can be used to run external
7+
# watchers to your application. For example, we use it
8+
# with webpack to recompile .js and .css sources.
9+
config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
10+
http: [port: 4000],
11+
debug_errors: true,
12+
code_reloader: true,
13+
check_origin: false,
14+
watchers: []
15+
16+
# ## SSL Support
17+
#
18+
# In order to use HTTPS in development, a self-signed
19+
# certificate can be generated by running the following
20+
# Mix task:
21+
#
22+
# mix phx.gen.cert
23+
#
24+
# Note that this task requires Erlang/OTP 20 or later.
25+
# Run `mix help phx.gen.cert` for more information.
26+
#
27+
# The `http:` config above can be replaced with:
28+
#
29+
# https: [
30+
# port: 4001,
31+
# cipher_suite: :strong,
32+
# keyfile: "priv/cert/selfsigned_key.pem",
33+
# certfile: "priv/cert/selfsigned.pem"
34+
# ],
35+
#
36+
# If desired, both `http:` and `https:` keys can be
37+
# configured to run both http and https servers on
38+
# different ports.
39+
40+
# Watch static and templates for browser reloading.
41+
config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
42+
live_reload: [
43+
patterns: [
44+
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
45+
~r"priv/gettext/.*(po)$",
46+
~r"lib/docker_elixir_19_release_web/{live,views}/.*(ex)$",
47+
~r"lib/docker_elixir_19_release_web/templates/.*(eex)$"
48+
]
49+
]
50+
51+
# Do not include metadata nor timestamps in development logs
52+
config :logger, :console, format: "[$level] $message\n"
53+
54+
# Set a higher stacktrace during development. Avoid configuring such
55+
# in production as building large stacktraces may be expensive.
56+
config :phoenix, :stacktrace_depth, 20
57+
58+
# Initialize plugs at runtime for faster development compilation
59+
config :phoenix, :plug_init_mode, :runtime

config/prod.exs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
use Mix.Config
2+
3+
# For production, don't forget to configure the url host
4+
# to something meaningful, Phoenix uses this information
5+
# when generating URLs.
6+
#
7+
# Note we also include the path to a cache manifest
8+
# containing the digested version of static files. This
9+
# manifest is generated by the `mix phx.digest` task,
10+
# which you should run after static files are built and
11+
# before starting your production server.
12+
config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
13+
url: [host: "example.com", port: 80],
14+
cache_static_manifest: "priv/static/cache_manifest.json"
15+
16+
# Do not print debug messages in production
17+
config :logger, level: :info
18+
19+
# ## SSL Support
20+
#
21+
# To get SSL working, you will need to add the `https` key
22+
# to the previous section and set your `:url` port to 443:
23+
#
24+
# config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
25+
# ...
26+
# url: [host: "example.com", port: 443],
27+
# https: [
28+
# :inet6,
29+
# port: 443,
30+
# cipher_suite: :strong,
31+
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
32+
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")
33+
# ]
34+
#
35+
# The `cipher_suite` is set to `:strong` to support only the
36+
# latest and more secure SSL ciphers. This means old browsers
37+
# and clients may not be supported. You can set it to
38+
# `:compatible` for wider support.
39+
#
40+
# `:keyfile` and `:certfile` expect an absolute path to the key
41+
# and cert in disk or a relative path inside priv, for example
42+
# "priv/ssl/server.key". For all supported SSL configuration
43+
# options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1
44+
#
45+
# We also recommend setting `force_ssl` in your endpoint, ensuring
46+
# no data is ever sent via http, always redirecting to https:
47+
#
48+
# config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
49+
# force_ssl: [hsts: true]
50+
#
51+
# Check `Plug.SSL` for all available options in `force_ssl`.
52+
53+
# ## Using releases (Elixir v1.9+)
54+
#
55+
# If you are doing OTP releases, you need to instruct Phoenix
56+
# to start each relevant endpoint:
57+
#
58+
# config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint, server: true
59+
#
60+
# Then you can assemble a release by calling `mix release`.
61+
# See `mix help release` for more information.
62+
63+
# Finally import the config/prod.secret.exs which loads secrets
64+
# and configuration from environment variables.
65+
import_config "prod.secret.exs"

config/prod.secret.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# In this file, we load production configuration and
2+
# secrets from environment variables. You can also
3+
# hardcode secrets, although such is generally not
4+
# recommended and you have to remember to add this
5+
# file to your .gitignore.
6+
use Mix.Config
7+
8+
secret_key_base =
9+
System.get_env("SECRET_KEY_BASE") ||
10+
raise """
11+
environment variable SECRET_KEY_BASE is missing.
12+
You can generate one by calling: mix phx.gen.secret
13+
"""
14+
15+
config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
16+
http: [:inet6, port: String.to_integer(System.get_env("PORT") || "4000")],
17+
secret_key_base: secret_key_base

config/test.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use Mix.Config
2+
3+
# We don't run a server during test. If one is required,
4+
# you can enable the server option below.
5+
config :docker_elixir_19_release, DockerElixir19ReleaseWeb.Endpoint,
6+
http: [port: 4002],
7+
server: false
8+
9+
# Print only warnings and errors during test
10+
config :logger, level: :warn

lib/docker_elixir_19_release.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
defmodule DockerElixir19Release do
2+
@moduledoc """
3+
DockerElixir19Release keeps the contexts that define your domain
4+
and business logic.
5+
6+
Contexts are also responsible for managing your data, regardless
7+
if it comes from the database, an external API or others.
8+
"""
9+
end

0 commit comments

Comments
 (0)