This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "../css/app.css"; | |
import "phoenix_html"; | |
import { Socket } from "phoenix"; | |
import { LiveSocket } from "phoenix_live_view"; | |
import topbar from "../vendor/topbar"; | |
let Hooks = {}; | |
Hooks.Connect = { | |
mounted() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Release do | |
@app :my_app | |
def migrate do | |
load_app() | |
for repo <- repos() do | |
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATABASE_URL=ecto://user:pw@db_address/db_name | |
SECRET_KEY_BASE=your_secret_key_base | |
MIX_ENV=prod | |
APP_NAME=app_name | |
CONTAINER_NAME=app_container | |
IMAGE_NAME=app_image | |
APP_PORT=4000 | |
NETWORK=your_network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```elixir | |
# config/prod.exs | |
import Config | |
config :your_app_otp_name, YourAppWeb.Endpoint, | |
# url: [host: "example.com", port: 80], | |
url: [host: "localhost", port: 4000], | |
cache_static_manifest: "priv/static/cache_manifest.json" | |
# Do not print debug messages in production | |
config :logger, level: :info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```elixir | |
# config/prod.exs | |
import Config | |
config :theme_ci_admin, YourAppWeb.Endpoint, | |
# url: [host: "example.com", port: 80], | |
url: [host: "localhost", port: 4000], | |
cache_static_manifest: "priv/static/cache_manifest.json" | |
# Do not print debug messages in production | |
config :logger, level: :info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/config.exs | |
# This file is responsible for configuring your application | |
# and its dependencies with the aid of the Mix.Config module. | |
# | |
# This configuration file is loaded before any dependency and | |
# is restricted to this project. | |
# General application configuration | |
import Config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifneq (,$(wildcard ./.env)) | |
include .env | |
export | |
endif | |
build: | |
ifdef VERSION | |
docker build --rm \ | |
--build-arg DATABASE_URL=$(DATABASE_URL) \ | |
--build-arg SECRET_KEY_BASE=$(SECRET_KEY_BASE) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM hexpm/elixir:1.11.2-erlang-23.1.2-alpine-3.12.1 as build | |
# install build dependencies | |
RUN apk add --no-cache build-base npm git python3 curl | |
# prepare build dir | |
WORKDIR /app | |
# install hex + rebar | |
RUN mix local.hex --force && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var serverResponseCode: Int? = 404 | |
// serverResponseCode contains an actual Int value of 404 | |
serverResponseCode = nil | |
// serverResponseCode now contains no value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let http404Error = (404, "Not Found") |
NewerOlder