Skip to content

Commit

Permalink
Merge pull request #403 from mbta/just_erlang_elixir_upgrade
Browse files Browse the repository at this point in the history
Upgrades Elixir and erlang versions
  • Loading branch information
Adzz authored Oct 28, 2024
2 parents 263145f + ad544ef commit cff71e1
Show file tree
Hide file tree
Showing 17 changed files with 8,979 additions and 11,722 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ jobs:
id: deps-cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-v2-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-v2-
path: |
deps
_build
key: ${{ runner.os }}-mix-v3-${{ hashFiles('.tool-versions') }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-v3-
- name: Install dependencies (if needed)
if: steps.deps-cache.outputs.cache-hit != 'true'
run: mix deps.get
Expand Down
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.11.4-otp-23
erlang 23.3.4.18
nodejs 16.20.0
elixir 1.17.3-otp-27
erlang 27.1.1
nodejs 20.18.0
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# First, get the elixir dependencies within an elixir container
FROM hexpm/elixir:1.11.4-erlang-23.3.4.18-alpine-3.16.2 AS elixir-builder
FROM hexpm/elixir:1.17.3-erlang-27.1-alpine-3.19.4 as elixir-builder

ENV LANG="C.UTF-8" MIX_ENV=prod

Expand All @@ -12,7 +12,7 @@ RUN mix local.hex --force && \
mix do deps.get --only prod

# Next, build the frontend assets within a node.js container
FROM node:16.20-alpine as assets-builder
FROM node:20-alpine3.19 as assets-builder

WORKDIR /root
ADD . .
Expand All @@ -36,9 +36,9 @@ COPY --from=assets-builder /root/priv/static ./priv/static
RUN mix do compile --force, phx.digest, release

# Finally, use an Alpine container for the runtime environment
FROM alpine:3.16.2
FROM alpine:3.19.4

RUN apk add --update libssl1.1 ncurses-libs bash curl dumb-init \
RUN apk add --update libstdc++ ncurses-libs bash curl dumb-init \
&& apk upgrade \
&& rm -rf /var/cache/apk

Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Document Viewer is a web application allowing users with permission to view docu

[![Build Status](https://github.com/mbta/document_viewer/actions/workflows/elixir.yml/badge.svg)](https://github.com/mbta/document_viewer/actions/workflows/elixir.yml)

## Testing Docker

On MBTA machines docker for desktop is [not allowed](https://github.com/mbta/technology-docs/blob/main/rfcs/accepted/0010-docker-desktop-replacement.md). Instead you must first install Colma:

```sh
brew install colima docker
colima start
``

Then you can test building the docker container by:

```sh
docker build . -t document_viewer; docker run document_viewer
```

## Development

To start your Phoenix server:
Expand Down
Loading

0 comments on commit cff71e1

Please sign in to comment.