Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IN-PROGRESS: Simply 3661 registry search #190

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
##############################################################################
# This is a multi-stage Dockerfile with three targets:
# * libreg_local_db
# * webapp_dev
# * webapp_prod
# * libreg_local
# * libreg_active
#
# For background on multi-stage builds, see:
#
Expand Down Expand Up @@ -165,12 +165,12 @@ ENTRYPOINT ["/bin/sh", "-c", "/docker-entrypoint.sh"]


##############################################################################
# Build target: libreg_dev
# Build target: libreg_local
#
# Note that this target assumes a host mount is in place to link the current
# directory into the container at /simplye_app. The production target copies in
# the entire project directory since it will remain static.
FROM builder AS libreg_dev
FROM builder AS libreg_local

ENV FLASK_ENV development
ENV SIMPLYE_RUN_WEBPACK_WATCH 1
Expand All @@ -181,9 +181,9 @@ RUN apk add --no-cache npm


##############################################################################
# Build target: libreg_prod
# Build target: libreg_active
#
FROM builder AS libreg_prod
FROM builder AS libreg_active

ENV FLASK_ENV production

Expand Down
51 changes: 28 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
.PHONY: help build db-session webapp-shell up up-watch start stop down test clean full-clean build-prod up-prod up-prod-watch test-prod down-prod
.PHONY: help build db-session webapp-shell up up-watch start stop down test clean full-clean build-active up-active up-active-watch test-active down-active
.DEFAULT_GOAL := help

help:
@echo "Usage: make [COMMAND]"
@echo ""
@echo "Commands:"
@echo ""
@echo " build - Build the libreg_webapp and libreg_local_db images"
@echo " db-session - Start a psql session as the superuser on the db container"
@echo " webapp-shell - Open a shell on the webapp container"
@echo " up - Bring up the local cluster in detached mode"
@echo " up-watch - Bring up the local cluster, remains attached"
@echo " start - Start a stopped cluster"
@echo " stop - Stop the cluster without removing containers"
@echo " down - Take down the local cluster"
@echo " test - Run the python test suite on the webapp container"
@echo " clean - Take down the local cluster and removes the db volume"
@echo " full-clean - Take down the local cluster and remove containers, volumes, and images"
@echo " build-prod - Build images based on the docker-compose-cicd.yml file"
@echo " up-prod - Bring up the cluster from the docker-compose-cicd.yml file"
@echo " up-prod-watch - Bring up the cluster from the cicd file, stay attached"
@echo " test-prod - Run the test suite on the prod container"
@echo " down-prod - Stop the cluster from the cicd file"
@echo " Related to Local Development:"
@echo ""
@echo " build - Build the libreg_webapp and libreg_local_db images"
@echo " db-session - Start a psql session as the superuser on the db container"
@echo " webapp-shell - Open a shell on the webapp container"
@echo " up - Bring up the local cluster in detached mode"
@echo " up-watch - Bring up the local cluster, remains attached"
@echo " start - Start a stopped cluster"
@echo " stop - Stop the cluster without removing containers"
@echo " down - Take down the local cluster"
@echo " test - Run the python test suite on the webapp container"
@echo " clean - Take down the local cluster and removes the db volume"
@echo " full-clean - Take down the local cluster and remove containers, volumes, and images"
@echo ""
@echo " Related to Deployment:"
@echo ""
@echo " build-active - Build images based on the docker-compose-cicd.yml file"
@echo " up-active - Bring up the cluster from the docker-compose-cicd.yml file"
@echo " up-active-watch - Bring up the cluster from the cicd file, stay attached"
@echo " test-active - Run the test suite on the local libreg_active_webapp container"
@echo " down-active - Stop the cluster from the cicd file"

build:
docker-compose build
Expand Down Expand Up @@ -56,17 +61,17 @@ clean:
full-clean:
docker-compose down --volumes --rmi all

build-prod:
build-active:
docker-compose -f docker-compose-cicd.yml build

up-prod:
up-active:
docker-compose -f docker-compose-cicd.yml up -d

up-prod-watch:
up-active-watch:
docker-compose -f docker-compose-cicd.yml up

test-prod:
docker exec -it libreg_prod_webapp pipenv run pytest tests
test-active:
docker exec -it libreg_active_webapp pipenv run pytest tests

down-prod:
down-active:
docker-compose -f docker-compose-cicd.yml down
Loading