Skip to content

Commit

Permalink
Merge pull request #26 from Helithumper/23-dockerize
Browse files Browse the repository at this point in the history
Application Dockerized w/ Redis, Freeze requirements
  • Loading branch information
jontyms authored Mar 18, 2024
2 parents fd398e1 + 015f8c9 commit 42824f1
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 31 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Docker Image

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker image
run: docker build . -t onboardlite

- name: Verify Docker image
run: docker run --rm onboardlite echo "Docker image built successfully!"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ clouds.yaml
infra_options.json
_deploy.sh
HackUCF.ovpn
config.yml
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the official Python base image
FROM python:3.11-bookworm

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file to the container
COPY requirements.txt .

# Install build-essential
RUN apt-get update && apt-get install -y build-essential

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code to the container
COPY . .

# Expose the port that the FastAPI application will run on
EXPOSE 8000

# Start the FastAPI application
CMD ["uvicorn", "index:app", "--host", "0.0.0.0", "--port", "8000"]
20 changes: 10 additions & 10 deletions redacted-config.yml → config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ infra:
tf_directory: "./"

discord:
client_id:
secret:
client_id: ""
secret: ""
redirect_base: "https://join.hackucf.org/api/oauth/?redir="
scope: "email identify guilds.join"
bot_token:
guild_id:
member_role:
bot_token: ""
guild_id: ""
member_role: ""


stripe:
api_key:
webhook_secret:
price_id:
api_key: ""
webhook_secret: ""
price_id: ""
url:
success: "https://join.hackucf.org/final/"
failure: "https://join.hackucf.org/pay/"
Expand All @@ -41,8 +41,8 @@ aws:

email:
smtp_server: smtp.gmail.com
email: *****@hackucf.org
password:
email: "*****@hackucf.org"
password: ""

redis:
host: "localhost"
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'
services:
fastapi:
build: .
ports:
- 8000:8000
volumes:
- ./config.yml:/app/config/options.yml

redis:
image: redis:7.2
96 changes: 75 additions & 21 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,76 @@
requests
fastapi
pydantic==1.10.10
python-jose
requests_oauthlib
gspread
boto3
botocore
pre-commit
stripe
uvicorn[standard]
passwordgenerator
python-terraform
airpress
cffi
openstacksdk
asyncio
pyopenssl==22.1.0
airpress==1.0.3
anyio==4.3.0
async-timeout==4.0.3
asyncio==3.4.3
black==23.9.1
jinja2
commonmark
redis
boto3==1.34.59
botocore==1.34.59
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
cfgv==3.4.0
charset-normalizer==3.3.2
click==8.1.7
commonmark==0.9.1
cryptography==38.0.4
decorator==5.1.1
distlib==0.3.8
dogpile.cache==1.3.2
ecdsa==0.18.0
fastapi==0.110.0
filelock==3.13.1
google-auth==2.28.2
google-auth-oauthlib==1.2.0
gspread==6.0.2
h11==0.14.0
httptools==0.6.1
identify==2.5.35
idna==3.6
iso8601==2.1.0
Jinja2==3.1.3
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==2.4
keystoneauth1==5.6.0
MarkupSafe==2.1.5
mypy-extensions==1.0.0
netifaces==0.11.0
nodeenv==1.8.0
oauthlib==3.2.2
openstacksdk==3.0.0
os-service-types==1.7.0
packaging==23.2
passwordgenerator==1.5.1
pathspec==0.12.1
pbr==6.0.0
platformdirs==4.2.0
pre-commit==3.6.2
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
pydantic==1.10.10
pyOpenSSL==22.1.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-jose==3.3.0
python-terraform==0.10.1
PyYAML==6.0.1
redis==5.0.2
requests==2.31.0
requests-oauthlib==1.3.1
requestsexceptions==1.4.0
rsa==4.9
s3transfer==0.10.0
six==1.16.0
sniffio==1.3.1
starlette==0.36.3
stevedore==5.2.0
StrEnum==0.4.15
stripe==8.6.0
typing_extensions==4.10.0
urllib3==2.0.7
uvicorn==0.28.0
uvloop==0.19.0
virtualenv==20.25.1
watchfiles==0.21.0
websockets==12.0

0 comments on commit 42824f1

Please sign in to comment.