Skip to content

Commit

Permalink
Remove unnecessary Postgres + Traefik config
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanemachine committed Oct 4, 2023
1 parent b07607e commit 3b4a970
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 25 deletions.
8 changes: 4 additions & 4 deletions support/containers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ To run this project's built-in Traefik container service:
- Launch the **Postgres + Traefik + Phoenix** container service:
- Examples:
- In a local environment (HTTP only):
- Docker: `docker compose -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-local.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f networks/compose.postgres-traefik.yaml -f compose.traefik.yaml -f compose.traefik-config-local.yaml up`
- Podman: `docker-compose -H unix:$(podman info --format '{{.Host.RemoteSocket.Path}}') -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-local.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f networks/compose.postgres-traefik.yaml -f compose.traefik.yaml -f compose.traefik-config-local.yaml up`
- Docker: `docker compose -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-local.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-local.yaml up`
- Podman: `docker-compose -H unix:$(podman info --format '{{.Host.RemoteSocket.Path}}') -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-local.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-local.yaml up`
- In a remote environment (exposed to Internet, uses HTTPS):
- Docker: `docker compose -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-remote.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f networks/compose.postgres-traefik.yaml -f compose.traefik.yaml -f compose.traefik-config-remote.yaml up`
- Podman: `podman-compose -H unix:$(podman info --format '{{.Host.RemoteSocket.Path}}') -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-remote.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f networks/compose.postgres-traefik.yaml -f compose.traefik.yaml -f compose.traefik-config-remote.yaml up`
- Docker: `docker compose -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-remote.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-remote.yaml up`
- Podman: `podman-compose -H unix:$(podman info --format '{{.Host.RemoteSocket.Path}}') -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-remote.yaml -f compose.phoenix-postgres.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-remote.yaml up`
- To avoid running these long commands, use the easy-use scripts in `support/containers/scripts`.
- To access the Traefik dashboard:
- Using a web browser, navigate to the location of your `$TRAEFIK_DASHBOARD_FQDN`.
Expand Down
10 changes: 10 additions & 0 deletions support/containers/compose.phoenix-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@ services:
phoenix:
depends_on:
- "postgres"
networks:
- "phoenix-todo-list"
postgres:
networks:
- "phoenix-todo-list"
ports:
- "5432"

networks:
phoenix-todo-list:
15 changes: 0 additions & 15 deletions support/containers/networks/compose.postgres-traefik.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions support/scripts/containers/compose--phoenix-postgres-traefik
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if [ "$action" = "up" ]; then
# ensure the network 'traefik-global-proxy' exists
echo "Creating Docker network: 'traefik-global-proxy'..."
if [ ! "$(docker network create traefik-global-proxy)" ]; then
echo "\033[96mThe 'traefik-global-proxy' network already exists.\033[39m"
printf "\033[96mThe 'traefik-global-proxy' network already exists.\033[39m\n"
fi
fi

Expand All @@ -74,4 +74,4 @@ fi

# run container action
# shellcheck disable=SC2068,SC2086
$application_to_run -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-$local_or_remote.yaml -f compose.postgres.yaml -f networks/compose.postgres-traefik.yaml -f compose.traefik.yaml -f compose.traefik-config-$local_or_remote.yaml $action $@
$application_to_run -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-$local_or_remote.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-$local_or_remote.yaml $action $@
6 changes: 2 additions & 4 deletions support/scripts/systemd-container-service-file-generate
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ fi
if [ "$use_postgres" = 1 ]; then
containers_to_run="$containers_to_run -f compose.phoenix-postgres.yaml -f compose.postgres.yaml"

# postgres + traefik
if [ "$use_traefik_client" = 1 ] || [ "$use_traefik_host" = 1 ]; then
containers_to_run="$containers_to_run -f networks/compose.postgres-traefik.yaml"
else
# enable postgres host networking
if [ "$use_traefik_client" != 1 ] && [ "$use_traefik_host" != 1 ]; then
containers_to_run="$containers_to_run -f networks/compose.postgres-host.yaml"
fi
fi
Expand Down

0 comments on commit 3b4a970

Please sign in to comment.