-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3a86c9
commit 99f3c4f
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '3.4' | ||
services: | ||
backend: | ||
build: | ||
context: . | ||
dockerfile: ./dockerfiles/backend/Dockerfile | ||
env_file: frontend/.env | ||
ports: | ||
- '5000:5000' | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:5000/healthy"] | ||
interval: 1s | ||
timeout: 3s | ||
retries: 10 | ||
frontend: | ||
build: | ||
context: . | ||
dockerfile: ./dockerfiles/frontend/Dockerfile | ||
env_file: backend/.env | ||
ports: | ||
- '8080:8080' | ||
depends_on: | ||
- backend | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/"] | ||
interval: 1s | ||
timeout: 3s | ||
retries: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM python:3.9-slim | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
MAINTAINER arkanister "[email protected]" | ||
|
||
WORKDIR /app | ||
|
||
COPY backend/src/ . | ||
|
||
ADD ./backend/requirements.pip / | ||
ADD ./dockerfiles/backend/gunicorn.py / | ||
|
||
# required for healthy check | ||
RUN apt update && apt install curl -y | ||
|
||
# install requirements | ||
RUN pip install gunicorn==20.0 && \ | ||
pip install -r /requirements.pip | ||
|
||
ENTRYPOINT ["gunicorn", "-c", "/gunicorn.py", "wsgi:application"] | ||
EXPOSE 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
Application Configuration File | ||
https://docs.gunicorn.org/en/stable/settings.html#settings | ||
""" | ||
import os | ||
import multiprocessing | ||
|
||
|
||
# Chdir to specified directory before apps loading. | ||
# https://docs.gunicorn.org/en/stable/settings.html#chdir | ||
chdir = '/app/' | ||
|
||
# Bind the application on localhost both on ipv6 and ipv4 interfaces. | ||
# https://docs.gunicorn.org/en/stable/settings.html#bind | ||
bind = '0.0.0.0:5000' | ||
|
||
|
||
#################### | ||
# Worker Processes # | ||
#################### | ||
|
||
# The number of worker processes for handling requests. | ||
# https://docs.gunicorn.org/en/stable/settings.html#workers | ||
workers = multiprocessing.cpu_count() * 2 + 1 | ||
|
||
# The number of worker threads for handling requests. | ||
# https://docs.gunicorn.org/en/stable/settings.html#threads | ||
threads = 2 * multiprocessing.cpu_count() | ||
|
||
# The maximum number of requests a worker will process before restarting. | ||
# https://docs.gunicorn.org/en/stable/settings.html#max-requests | ||
max_requests = os.getenv('GUNICORN_WORKER_MAX_REQUESTS', default=2400) | ||
|
||
# The maximum jitter to add to the max_requests setting. | ||
# https://docs.gunicorn.org/en/stable/settings.html#max-requests-jitter | ||
max_requests_jitter = os.getenv('GUNICORN_WORKER_MAX_REQUESTS_JITTER', default=50) | ||
|
||
# Workers silent for more than this many seconds are killed and restarted. | ||
# https://docs.gunicorn.org/en/stable/settings.html#timeout | ||
timeout = os.getenv('GUNICORN_WORKER_TIMEOUT', default=30) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM node:lts-alpine | ||
|
||
MAINTAINER arkanister "[email protected]" | ||
|
||
# install simple http server for serving static content | ||
RUN npm install -g http-server | ||
|
||
WORKDIR /app | ||
|
||
# copy both 'package.json' and 'package-lock.json' (if available) | ||
COPY frontend/ . | ||
|
||
# install project dependencies | ||
RUN npm install | ||
|
||
# build app for production with minification | ||
RUN npm run build | ||
|
||
ENTRYPOINT ["http-server", "dist"] | ||
EXPOSE 8080 |