Skip to content

Commit

Permalink
Updated config.
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-br committed Apr 22, 2024
1 parent 573d902 commit 712259c
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Deploy to AWS ECR

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Update submodules
run: git submodule update --init --recursive

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true

- name: Build, Tag, and Push Docker image to ECR
run: |
docker build -t clearsettleengineadmin .
docker tag clearsettleengineadmin 211125762589.dkr.ecr.us-west-2.amazonaws.com/repo:clearsettleengineadmin
docker push 211125762589.dkr.ecr.us-west-2.amazonaws.com/repo:clearsettleengineadmin
env:
AWS_DEFAULT_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use an official Elixir runtime as a parent image
FROM elixir:latest

# Create and set the working directory
WORKDIR /app

# Copy the mix.exs and mix.lock files to the container
COPY mix.exs mix.lock ./

# Install hex and rebar

RUN mix archive.install github hexpm/hex branch latest --force

RUN mix local.rebar --force
# Install dependencies
RUN mix deps.get

# Copy the rest of your application's code
COPY . .

# Compile the project

RUN mix do compile

# Run the application
CMD ["mix", "run"]
10 changes: 10 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ config :clear_settle_engine_admin, ClearSettleEngineAdminWeb.Endpoint,
pubsub_server: ClearSettleEngineAdmin.PubSub,
live_view: [signing_salt: "kLC5F5Sh"]

config :clear_settle_engine, ClearSettleEngine.Repo,
username: System.get_env("DB_USERNAME", "postgres"),
password: System.get_env("DB_PASSWORD", ""),
database: System.get_env("DB_DATABASE", "clear_settle_engine_dev"),
hostname: System.get_env("DB_HOST", "localhost"),
port: System.get_env("DB_PORT", "5432"),
ssl: true,
ssl_opts: [verify: :verify_none],
pool_size: String.to_integer(System.get_env("DB_POOL_SIZE", "10"))

# Configures the mailer
#
# By default it uses the "Local" adapter which stores the emails
Expand Down
16 changes: 8 additions & 8 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Config

# Configure your database
config :clear_settle_engine_admin, ClearSettleEngineAdmin.Repo,
username: "postgres",
password: "",
hostname: "localhost",
database: "clear_settle_engine_dev",
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10
# config :clear_settle_engine_admin, ClearSettleEngineAdmin.Repo,
# username: "postgres",
# password: "",
# hostname: "localhost",
# database: "clear_settle_engine_dev",
# stacktrace: true,
# show_sensitive_data_on_connection_error: true,
# pool_size: 10

# For development, we disable any cache and enable
# debugging and code reloading.
Expand Down

0 comments on commit 712259c

Please sign in to comment.