-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
71f6e8f
commit af9e3bf
Showing
8 changed files
with
110 additions
and
15 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,9 @@ | ||
.git/ | ||
.github/ | ||
types_/ | ||
config.template.toml | ||
Dockerfile | ||
LICENSE | ||
migration.sql | ||
pyproject.toml | ||
README.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,2 @@ | ||
POSTGRES_USER=mystbin | ||
POSTGRES_PASSWORD=mystbin |
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.12-slim | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/pythonistaguild/mystbin-backend | ||
LABEL org.opencontainers.image.description="Mystbin's Python Backend" | ||
LABEL org.opencontainers.image.licenses=GPLv3 | ||
|
||
RUN mkdir -p /etc/apt/keyrings \ | ||
&& apt update -y \ | ||
&& apt-get install --no-install-recommends -y \ | ||
# deps for building python deps | ||
git \ | ||
build-essential \ | ||
libcurl4-gnutls-dev \ | ||
gnutls-dev \ | ||
libmagic-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# copy project requirement files here to ensure they will be cached. | ||
WORKDIR /app | ||
COPY requirements.txt ./ | ||
|
||
# install runtime deps | ||
RUN pip install -Ur requirements.txt | ||
|
||
COPY . /app/ | ||
ENTRYPOINT python -O launcher.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
services: | ||
mystbin: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: mystbin | ||
ports: | ||
- 8181:8181 | ||
restart: unless-stopped | ||
depends_on: | ||
database: | ||
condition: service_healthy | ||
restart: true | ||
|
||
database: | ||
image: postgres:latest | ||
container_name: mystbin-database | ||
restart: unless-stopped | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
env_file: .env | ||
environment: | ||
- PG_DATA=/var/lib/postgresql/data | ||
- POSTGRES_DB=mystbin | ||
volumes: | ||
- mystbin_pg_data:/var/lib/postgresql/data | ||
|
||
redis: | ||
image: redis:latest | ||
container_name: mystbin-redis | ||
restart: unless-stopped | ||
profiles: | ||
- redis | ||
volumes: | ||
- "./redis.conf:/config/redis.conf:ro" | ||
command: ["redis-server", "/config/redis.conf"] | ||
|
||
volumes: | ||
mystbin_pg_data: |
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,2 @@ | ||
port 6379 | ||
requirepass ChangeMeHere!! |