Skip to content

Commit 5c8f5e8

Browse files
add Dockerfile to bookshelf (#486)
* add Dockerfile to bookshelf * use gunicorn entrypoint * fix line length for kokoro tests Co-authored-by: Charles Engelke <[email protected]>
1 parent 2321dfb commit 5c8f5e8

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

bookshelf/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use the official Python image.
2+
# https://hub.docker.com/_/python
3+
FROM python:3.10-slim
4+
5+
# Copy local code to the container image.
6+
ENV APP_HOME /app
7+
WORKDIR $APP_HOME
8+
COPY . ./
9+
10+
# Install production dependencies.
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Run the web service on container startup.
14+
ENTRYPOINT [ "gunicorn", "--bind", "0.0.0.0:8080", "main:app" ]

bookshelf/main_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ def app(request):
4242
def firestore():
4343

4444
import firestore
45-
"""This fixture provides a modified version of the app's Firebase model that
46-
tracks all created items and deletes them at the end of the test.
45+
"""This fixture provides a modified version of the app's Firebase model
46+
that tracks all created items and deletes them at the end of the test.
4747
48-
Any tests that directly or indirectly interact with the database should use
49-
this to ensure that resources are properly cleaned up.
48+
Any tests that directly or indirectly interact with the database should
49+
use this to ensure that resources are properly cleaned up.
5050
"""
5151

5252
# Ensure no books exist before running the tests. This typically helps if

0 commit comments

Comments
 (0)