Skip to content

Commit

Permalink
Upgrade phoenix/elixir/erlang
Browse files Browse the repository at this point in the history
  • Loading branch information
iacutone committed Oct 21, 2023
1 parent f2fdce0 commit 4f82e66
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.13.4-otp-25
erlang 25.0.2
elixir 1.14.2-otp-25
erlang 25.1.2
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
# This file is based on these images:
#
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20210902-slim - for the release image
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20221004-slim - for the release image
# - https://pkgs.org/ - resource for finding needed packages
# - Ex: hexpm/elixir:1.13.4-erlang-25.0.2-debian-bullseye-20210902-slim
# - Ex: hexpm/elixir:1.14.2-erlang-25.1.2-debian-bullseye-20221004-slim
#
ARG ELIXIR_VERSION=1.13.4
ARG OTP_VERSION=25.0.2
ARG DEBIAN_VERSION=bullseye-20210902-slim
ARG ELIXIR_VERSION=1.14.2
ARG OTP_VERSION=25.1.2
ARG DEBIAN_VERSION=bullseye-20221004-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
Expand All @@ -23,17 +23,18 @@ FROM ${BUILDER_IMAGE} as builder

# install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
&& apt-get clean && rm -f /var/lib/apt/lists/*_*

# prepare build dir
WORKDIR /app

# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
mix local.rebar --force

# set build ENV
ENV MIX_ENV="prod"
ENV SECRET_KEY_BASE="a735d2f609b1648d828b0a051b39df4c"

# install mix dependencies
COPY mix.exs mix.lock ./
Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# We don't run a server during test. If one is required,
# you can enable the server option below.
Expand Down
40 changes: 19 additions & 21 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
# fly.toml app configuration file generated for music-voter on 2023-10-21T15:45:45-04:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "music-voter"
primary_region = "mia"

kill_signal = "SIGTERM"
kill_timeout = "5s"
kill_timeout = 5
processes = []

[env]

[experimental]
allowed_public_ports = []
auto_rollback = true

[env]
PHX_HOST = "music-voter.fly.dev"
PORT = "8080"

[[services]]
protocol = "tcp"
internal_port = 8080
http_checks = []
internal_port = 4000
processes = ["app"]
protocol = "tcp"
script_checks = []

[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"

[[services.ports]]
port = 80
handlers = ["http"]
force_https = true
port = 80

[[services.ports]]
port = 443
handlers = ["tls", "http"]
[services.concurrency]
type = "connections"
hard_limit = 25
soft_limit = 20
port = 443

[[services.tcp_checks]]
grace_period = "30s" # allow some time for startup
interval = "15s"
restart_limit = 0
timeout = "2s"
grace_period = "1s"
1 change: 1 addition & 0 deletions lib/music_voter_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ defmodule MusicVoterWeb do
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML

import Phoenix.Component
# Import LiveView helpers (live_render, live_component, live_patch, etc)
import Phoenix.LiveView.Helpers

Expand Down
13 changes: 7 additions & 6 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ defmodule MusicVoter.MixProject do
[
app: :music_voter,
version: "0.1.0",
elixir: "~> 1.13.4",
elixir: "~> 1.14.2",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix] ++ Mix.compilers(),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
Expand All @@ -34,12 +34,13 @@ defmodule MusicVoter.MixProject do
defp deps do
[
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:phoenix, "~> 1.6.11"},
{:phoenix, "~> 1.7.9"},
{:phoenix_html, "~> 3.1"},
{:phoenix_live_dashboard, "~> 0.5"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.17.11"},
{:phoenix_live_dashboard, "~> 0.8.2"},
{:phoenix_live_reload, "~> 1.4", only: :dev},
{:phoenix_live_view, "~> 0.20.1"},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_view, "~> 2.0"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.11"},
Expand Down
Loading

0 comments on commit 4f82e66

Please sign in to comment.