Skip to content

Commit

Permalink
Unique image names for each stage.
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerOrtiz committed Mar 20, 2024
1 parent 584a1dd commit 0c5fb9d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# TODO: Get google creds working
GOOGLE_APPLICATION_CREDENTIALS=<your-google-credentials>
FIREBASE_TOKEN=<your-firebase-token>
# None of these are necessary to change unless you want it to be different
# GOOGLE_APPLICATION_CREDENTIALS=<your-google-credentials-file-path>
# FIREBASE_CONFIG=<your-firebase-config-file-path>
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,46 @@

## Introduction...

This project assists the collection and distribution of unused and gently used baby and child equipment. Over twenty dif.ferent organizations are served by this exchange.
This project assists the collection and distribution of unused and gently used baby and child equipment. Over twenty different organizations are served by this exchange.

## Dev Local Setup - Docker Compose Option
[Docker compose](https://docs.docker.com/compose/intro/features-uses/) provides a way to manage and orchestrate local environment services.

Currently, we use 3 services:
- firebase - Our firebase emulator which provides access to local firebase services
- functions - A convenient wrapper around our firebase functions project which aims to automate the dev build + reloading of the functions compilation.
- nextjs - Our main nextjs application

Pre-requisities
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)

Config Setup
1. Create / Acquire firebase configuration, `firebase-config.json`, put in the root directory.
2. Acquire Service Account Credentials, `service-account.json`, put in the root directory.

** Both of these files should be ignored by git **

Quick Start: `docker compose build && docker compose up -d`

In general, the urls that should be available after doing this:
- http://localhost:3000 - nextjs app
- http://localhost:4000 - firebase emulator ui
- http://localhost:5001 - functions api

Common Commands:
- Build `docker compose build` (builds all images)
- Start `docker compose up -d` (starts all services)
- Stop `docker compose down --remove-orphans --volumes` (stops all containers and cleans up)

Other Commands:
- Logs `docker compose logs --follow` (shows logs across all services)
- Run `docker compose run --no-deps -T --rm <service> <command>` (runs a one time <command> on a <service> (--no-deps dont start any other services) (--rm remove after run) (-T if running a background command that requires no input/shell))

Cleanup Commands:
Over time, images, containers, volumes will need to be cleaned up.
- Everything `docker system prune -a`
- Images `docker image prune -a`
- Volumes `docker volume prune -a`

## Dev remote Setup (Recommended for consistency, you can dev local if you don't want to work with docker)

Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:

firebase:
image: baby-equipment-exchange-image
image: baby-equipment-exchange-firebase
build:
context: .
target: firebase
Expand All @@ -19,7 +19,7 @@ services:
- "5001:5001" # Cloud Functions

functions:
image: baby-equipment-exchange-image
image: baby-equipment-exchange-functions
build:
context: .
target: functions
Expand All @@ -36,8 +36,8 @@ services:
depends_on:
- firebase

server-equipment-exchange:
image: baby-equipment-exchange-image
nextjs:
image: baby-equipment-exchange-nextjs
build:
context: .
target: app
Expand Down

0 comments on commit 0c5fb9d

Please sign in to comment.