Updated build tools to remove postgres

This commit is contained in:
Kieran Eglin 2024-02-16 09:50:15 -08:00
parent 80689517a1
commit 5a46a6accd
No known key found for this signature in database
GPG key ID: 193984967FCF432D
9 changed files with 3 additions and 36 deletions

View file

@ -1,3 +0,0 @@
POSTGRES_HOST=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres

View file

@ -24,9 +24,6 @@ jobs:
- name: Create and populate ENV file
run: |
echo MIX_ENV=test >> .env
echo POSTGRES_HOST=postgres >> .env
echo POSTGRES_USER=postgres >> .env
echo POSTGRES_PASSWORD=postgres >> .env
- name: Pull prebuilt images
run: docker compose pull

View file

@ -3,7 +3,7 @@ FROM elixir:latest
# Install debian packages
RUN apt-get update -qq
RUN apt-get install -y inotify-tools postgresql-client ffmpeg \
RUN apt-get install -y inotify-tools ffmpeg \
python3 python3-pip python3-setuptools python3-wheel python3-dev
# Install nodejs

View file

@ -6,7 +6,7 @@ config :pinchflat,
# Configure your database
config :pinchflat, Pinchflat.Repo,
database: Path.expand("../pinchflat_dev.db", Path.dirname(__ENV__.file)),
database: Path.expand("../priv/repo/pinchflat_dev.db", Path.dirname(__ENV__.file)),
show_sensitive_data_on_connection_error: true,
pool_size: 5

View file

@ -14,7 +14,7 @@ config :pinchflat, Oban, testing: :manual
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :pinchflat, Pinchflat.Repo,
database: Path.expand("../pinchflat_test.db", Path.dirname(__ENV__.file)),
database: Path.expand("../priv/repo/pinchflat_test.db", Path.dirname(__ENV__.file)),
pool_size: 5,
pool: Ecto.Adapters.SQL.Sandbox

View file

@ -1,11 +1,5 @@
version: '3'
services:
postgres:
image: 'postgres:16-alpine'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
phx:
build: .
volumes:
@ -13,4 +7,3 @@ services:
ports:
- '4008:4008'
command: tail -F /dev/null
env_file: .env

View file

@ -1,22 +1,12 @@
version: '3'
services:
postgres:
image: 'postgres:16-alpine'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
phx:
build: .
volumes:
- '.:/app'
ports:
- '4008:4008'
depends_on:
- postgres
command:
- ./docker-run.sh
stdin_open: true
tty: true
env_file:
- .env

View file

@ -10,15 +10,6 @@ echo "\nInstalling JS..."
cd assets && yarn install
cd ..
# Wait for Postgres to become available.
export PGPASSWORD=$(echo $POSTGRES_PASSWORD)
until psql -h postgres -U $POSTGRES_USER -c '\q' 2>/dev/null; do
echo >&2 "Postgres is unavailable - sleeping"
sleep 1
done
echo "\nPostgres is available: continuing with database setup..."
# Potentially Set up the database
mix ecto.create
mix ecto.migrate

View file

@ -36,7 +36,6 @@ defmodule Pinchflat.MixProject do
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.10"},
{:ecto_sqlite3, ">= 0.0.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.3"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.20.1"},