Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
HOTFIX: Fix deployment (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
alysivji authored Jan 12, 2020
1 parent d66a37b commit d1cd197
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ docker-compose.yml
docker-compose-prod.yml
.travis.yml

.env.template
.env
.envrc
creds.txt

Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help
.PHONY: help logs

help: ## This help
@echo "Makefile for managing application:\n"
Expand Down Expand Up @@ -63,9 +63,8 @@ test-skipvcr: ## run non-vcr tests
lint: ## run flake8 linter
docker-compose exec app flake8

.PHONY: logs
logs: ## attach to logs
docker logs `docker-compose ps -q app`
docker-compose logs

debug: ## attach to app container for debugging
docker attach `docker-compose ps -q app`
Expand Down Expand Up @@ -113,3 +112,7 @@ prod-shell: ## shell into production container

prod-shell-db: ## shell into prodution postgres instance
psql -d "${DATABASE_URI}"

prod-logs: ## attach to logs in production container
docker-compose -f docker-compose.prod.yml logs

11 changes: 5 additions & 6 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ ENV PYTHONUNBUFFERED 1

WORKDIR /app

RUN groupadd -g 901 -r busybeaverdev \
&& useradd -g busybeaverdev -r -u 901 busybeaver_user \
&& mkdir /app/logs /home/busybeaver_user \
&& chmod -R 777 /app/logs /home/busybeaver_user

COPY requirements.txt requirements_dev.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/requirements_dev.txt

Expand All @@ -21,6 +16,10 @@ EXPOSE 5000
COPY ./ /app

# Switch from root user for security
USER busybeaverdev
RUN groupadd -g 901 -r busybeaverdev \
&& useradd -g busybeaverdev -r -u 901 busybeaver_user \
&& mkdir /app/logs /home/busybeaver_user \
&& chmod -R 777 /app/logs /home/busybeaver_user
USER busybeaver_user

ENTRYPOINT [ "scripts/entrypoint.sh" ]
9 changes: 4 additions & 5 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ ENV PYTHONUNBUFFERED 1

WORKDIR /app

RUN groupadd -g 901 -r busybeaverdev \
&& useradd -g busybeaverdev -r -u 901 busybeaver_user \
&& mkdir /app/logs /home/busybeaver_user \
&& chmod -R 777 /app/logs /home/busybeaver_user

COPY requirements.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/requirements.txt

Expand All @@ -21,6 +16,10 @@ EXPOSE 5000
COPY ./ /app

# Switch from root user for security
RUN groupadd -g 901 -r busybeaverdev \
&& useradd -g busybeaverdev -r -u 901 busybeaver_user \
&& mkdir /app/logs /home/busybeaver_user \
&& chmod -R 777 /app/logs /home/busybeaver_user
USER busybeaver_user

ENTRYPOINT [ "scripts/entrypoint.sh" ]

0 comments on commit d1cd197

Please sign in to comment.