-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
9 changed files
with
177 additions
and
16 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,11 @@ | ||
alembic | ||
tests | ||
trailblazer.egg-info | ||
.pytest_cache | ||
.github | ||
.editorconfig | ||
.gitignore | ||
.gitlint.yaml | ||
.pre-commit-config.yaml | ||
DEPLOYMENT.md | ||
|
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,26 @@ | ||
FROM python:3.7-slim | ||
|
||
ENV GUNICORN_WORKERS=1 | ||
ENV GUNICORN_TREADS=1 | ||
ENV GUNICORN_BIND="0.0.0.0:5000" | ||
ENV GUNICORN_TIMEOUT=400 | ||
|
||
WORKDIR /home/src/app | ||
COPY . /home/src/app | ||
|
||
RUN pip install -r requirements.txt | ||
RUN pip install -e . | ||
|
||
EXPOSE 5000 | ||
|
||
RUN useradd worker | ||
RUN chown -R worker:worker /home/src | ||
USER worker | ||
|
||
CMD gunicorn \ | ||
--workers=$GUNICORN_WORKERS \ | ||
--bind=$GUNICORN_BIND \ | ||
--threads=$GUNICORN_TREADS \ | ||
--timeout=$GUNICORN_TIMEOUT \ | ||
trailblazer.server.app:app | ||
|
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
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,42 @@ | ||
version: '3.8' | ||
|
||
services: | ||
mysql-server: | ||
image: mysql:5.6 | ||
container_name: trailblazer-database | ||
restart: always | ||
volumes: | ||
- ../testing/tb_dump:/docker-entrypoint-initdb.d:rw | ||
ports: | ||
- '3306' | ||
environment: | ||
MYSQL_ROOT_PASSWORD: rootpass | ||
MYSQL_USER: user | ||
MYSQL_PASSWORD: userpass | ||
MYSQL_DATABASE: trailblazer-stage | ||
networks: | ||
- trailblazer-network | ||
|
||
trailblazer: | ||
image: mropat/trailblazer | ||
container_name: trailblazer-api | ||
environment: | ||
SQLALCHEMY_DATABASE_URI: "mysql+pymysql://user:userpass@mysql-server:3306/trailblazer-stage" | ||
SCOPE: "DEVELOPMENT" | ||
GUNICORN_WORKERS: "3" | ||
GUNICORN_BIND: "0.0.0.0:5000" | ||
GUNICORN_TIMEOUT: "400" | ||
ports: | ||
- 7076:5000 | ||
networks: | ||
- trailblazer-network | ||
depends_on: | ||
- mysql-server | ||
|
||
networks: | ||
trailblazer-network: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
|
||
|
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
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,83 @@ | ||
# Generation of Kubernetes YAML is still under development! | ||
# | ||
# Save the output of this file and use kubectl create -f to import | ||
# it into Kubernetes. | ||
# | ||
# Created with podman-2.0.6 | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
creationTimestamp: "2020-11-29T09:43:55Z" | ||
labels: | ||
app: trailblazer-pod | ||
name: trailblazer-pod | ||
spec: | ||
containers: | ||
- name: trailblazer-stage-db | ||
env: | ||
- name: MYSQL_PASSWORD | ||
value: userpass | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: rootpass | ||
- name: MYSQL_USER | ||
value: user | ||
- name: MYSQL_DATABASE | ||
value: trailblazer-stage | ||
image: docker.io/library/mysql:5.6 | ||
ports: | ||
- contrinerPort: 3306 | ||
resources: {} | ||
securityContext: | ||
allowPrivilegeEscalation: true | ||
capabilities: {} | ||
privileged: false | ||
readOnlyRootFilesystem: false | ||
seLinuxOptions: {} | ||
volumeMounts: | ||
- mountPath: /docker-entrypoint-initdb.d | ||
name: home-admin-Documents-CG-testing-tb_dump | ||
workingDir: / | ||
|
||
- name: trailblazer-api | ||
env: | ||
- name: GUNICORN_TREADS | ||
value: "1" | ||
- name: GUNICORN_BIND | ||
value: 0.0.0.0:5000 | ||
- name: SCOPE | ||
value: DEVELOPMENT | ||
- name: GUNICORN_TIMEOUT | ||
value: "400" | ||
- name: SQLALCHEMY_DATABASE_URI | ||
value: mysql+pymysql://user:userpass@localhost:3306/trailblazer-stage | ||
- name: GUNICORN_WORKERS | ||
value: "1" | ||
image: docker.io/mropat/trailblazer:latest | ||
ports: | ||
- containerPort: 5000 | ||
hostPort: 7076 | ||
protocol: TCP | ||
resources: {} | ||
securityContext: | ||
allowPrivilegeEscalation: true | ||
capabilities: {} | ||
privileged: false | ||
readOnlyRootFilesystem: false | ||
runAsGroup: 1000 | ||
runAsUser: 1000 | ||
seLinuxOptions: {} | ||
workingDir: /home/src/app | ||
|
||
volumes: | ||
- hostPath: | ||
path: /home/admin/Documents/CG/testing/tb_dump | ||
type: Directory | ||
name: home-admin-Documents-CG-testing-tb_dump | ||
status: {} | ||
--- | ||
metadata: | ||
creationTimestamp: null | ||
spec: {} | ||
status: | ||
loadBalancer: {} | ||
|
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
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
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