Skip to content

Commit

Permalink
Merge pull request #9 from mozilla/feature/opschores
Browse files Browse the repository at this point in the history
adding dockerfile and gha pipeline
  • Loading branch information
tanfarming authored Apr 1, 2022
2 parents 7363156 + 7d18c44 commit ec1a0ad
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/turkeyportal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: turkeyportal
on:
push:
branches:
paths-ignore: ["README.md"]
workflow_dispatch:

jobs:
turkeyGitops:
uses: mozilla/hubs-ops/.github/workflows/turkeyGitops.yml@master
with:
registry: mozillareality
dockerfile: Dockerfile
secrets:
DOCKER_HUB_PWD: ${{ secrets.DOCKER_HUB_PWD }}
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ---- build stage ----
FROM elixir:1.13 as builder
RUN apt-get update -y && apt-get install -y build-essential git \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN mix local.rebar --force \
&& mix local.hex --force
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mkdir config
COPY config/config.exs config/${MIX_ENV}.exs config/
RUN mix deps.compile
COPY priv priv
COPY assets assets
# RUN mix assets.deploy
RUN mix phx.digest
COPY lib ./lib
RUN mix compile
COPY config/runtime.exs config/
# COPY rel rel
RUN mix release

# ---- app stage ----
from debian:bullseye-slim
RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR "/app"
RUN chown nobody /app
COPY --from=builder --chown=nobody:root /_build/prod/rel/prtl ./
USER nobody
CMD /app/bin/prtl start
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ defmodule Prtl.MixProject do
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"}
{:plug_cowboy, "~> 2.5"},
{:poison, "~> 5.0"}
]
end

Expand Down

0 comments on commit ec1a0ad

Please sign in to comment.