diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000..6943530 --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -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!" diff --git a/.gitignore b/.gitignore index 0102fe7..3676d1c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ clouds.yaml infra_options.json _deploy.sh HackUCF.ovpn +config.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..88c8b6e --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/redacted-config.yml b/config.yml similarity index 79% rename from redacted-config.yml rename to config.yml index 130dca2..85f9838 100644 --- a/redacted-config.yml +++ b/config.yml @@ -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/" @@ -41,8 +41,8 @@ aws: email: smtp_server: smtp.gmail.com - email: *****@hackucf.org - password: + email: "*****@hackucf.org" + password: "" redis: host: "localhost" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..01c0b66 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' +services: + fastapi: + build: . + ports: + - 8000:8000 + volumes: + - ./config.yml:/app/config/options.yml + + redis: + image: redis:7.2 diff --git a/requirements.txt b/requirements.txt index a51d9a0..9dd4a7a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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