This file contains hidden or 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
/.git | |
/_build | |
/deps | |
/assets/build | |
/assets/node_modules |
This file contains hidden or 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 node:10-alpine AS assets | |
WORKDIR /app/assets | |
COPY ./assets /app/assets | |
RUN yarn install && yarn build | |
FROM elixir:1.9.1-alpine | |
ARG MIX_ENV=prod | |
ARG DATABASE_URL=postgres://postgres:postgres@localhost/healthyskin_dev | |
ARG SECRET_KEY_BASE=secret | |
ENV MIX_HOME=/root/.mix |
This file contains hidden or 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
build: | |
docker: | |
web: Dockerfile | |
release: | |
image: web | |
command: | |
- POOL_SIZE=2 mix ecto.migrate | |
run: | |
web: mix phx.server |
This file contains hidden or 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 | |
import Config | |
config :goth, json: File.read!("priv/creds.json") | |
subscription = "projects/gcs-pubsub-1/subscriptions/api-subscription" | |
config :google_storage, | |
producer_module: {BroadwayCloudPubSub.Producer, subscription: subscription} |
This file contains hidden or 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 GoogleStorage.Pipeline do | |
use Broadway | |
require Logger | |
alias Broadway.Message | |
def start_link(opts) do | |
producer_module = Keyword.fetch!(opts, :producer_module) | |
Broadway.start_link(__MODULE__, |
This file contains hidden or 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 GoogleStorage.Application do | |
# ... | |
@impl true | |
def start(_type, _args) do | |
producer_module = Application.get_env(:google_storage, :producer_module) | |
children = [ | |
{GoogleStorage.Pipeline, [producer_module: producer_module]} |
OlderNewer