From bb8159954acd05b6b304551fb49c742ab626253d Mon Sep 17 00:00:00 2001 From: Edouard Bourque Date: Thu, 5 Sep 2024 09:10:52 -0400 Subject: [PATCH] Removed docker files --- .dockerignore | 34 -------------------- .vscode/settings.json | 4 +++ Dockerfile | 51 ------------------------------ README.Docker.md | 22 ------------- clashstats/clashstats/settings.py | 2 ++ compose.yaml | 49 ---------------------------- requirements.txt | Bin 352 -> 422 bytes 7 files changed, 6 insertions(+), 156 deletions(-) delete mode 100644 .dockerignore create mode 100644 .vscode/settings.json delete mode 100644 Dockerfile delete mode 100644 README.Docker.md delete mode 100644 compose.yaml diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 03a268b..0000000 --- a/.dockerignore +++ /dev/null @@ -1,34 +0,0 @@ -# Include any files or directories that you don't want to be copied to your -# container here (e.g., local build artifacts, temporary files, etc.). -# -# For more help, visit the .dockerignore file reference guide at -# https://docs.docker.com/go/build-context-dockerignore/ - -**/.DS_Store -**/__pycache__ -**/.venv -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/bin -**/charts -**/docker-compose* -**/compose.y*ml -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c186f1d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "appService.defaultWebAppToDeploy": "/subscriptions/6e6d6c28-fddf-481a-8115-a16b8f388b3d/resourceGroups/clashstats_group/providers/Microsoft.Web/sites/clashstats", + "appService.deploySubpath": "." +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 7276048..0000000 --- a/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -# syntax=docker/dockerfile:1 - -# Comments are provided throughout this file to help you get started. -# If you need more help, visit the Dockerfile reference guide at -# https://docs.docker.com/go/dockerfile-reference/ - -# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 - -ARG PYTHON_VERSION=3.11.9 -FROM python:${PYTHON_VERSION}-slim as base - -# Prevents Python from writing pyc files. -ENV PYTHONDONTWRITEBYTECODE=1 - -# Keeps Python from buffering stdout and stderr to avoid situations where -# the application crashes without emitting any logs due to buffering. -ENV PYTHONUNBUFFERED=1 - -WORKDIR /app - -# Create a non-privileged user that the app will run under. -# See https://docs.docker.com/go/dockerfile-user-best-practices/ -ARG UID=10001 -RUN adduser \ - --disabled-password \ - --gecos "" \ - --home "/nonexistent" \ - --shell "/sbin/nologin" \ - --no-create-home \ - --uid "${UID}" \ - appuser - -# Download dependencies as a separate step to take advantage of Docker's caching. -# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds. -# Leverage a bind mount to requirements.txt to avoid having to copy them into -# into this layer. -RUN --mount=type=cache,target=/root/.cache/pip \ - --mount=type=bind,source=requirements.txt,target=requirements.txt \ - python -m pip install -r requirements.txt - -# Switch to the non-privileged user to run the application. -USER appuser - -# Copy the source code into the container. -COPY . . - -# Expose the port that the application listens on. -EXPOSE 80 - -# Run the application. -CMD python clashstats/manage.py runserver localhost:80 diff --git a/README.Docker.md b/README.Docker.md deleted file mode 100644 index 3372b93..0000000 --- a/README.Docker.md +++ /dev/null @@ -1,22 +0,0 @@ -### Building and running your application - -When you're ready, start your application by running: -`docker compose up --build`. - -Your application will be available at http://localhost:80. - -### Deploying your application to the cloud - -First, build your image, e.g.: `docker build -t myapp .`. -If your cloud uses a different CPU architecture than your development -machine (e.g., you are on a Mac M1 and your cloud provider is amd64), -you'll want to build the image for that platform, e.g.: -`docker build --platform=linux/amd64 -t myapp .`. - -Then, push it to your registry, e.g. `docker push myregistry.com/myapp`. - -Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/) -docs for more detail on building and pushing. - -### References -* [Docker's Python guide](https://docs.docker.com/language/python/) \ No newline at end of file diff --git a/clashstats/clashstats/settings.py b/clashstats/clashstats/settings.py index 851f505..9dd99db 100644 --- a/clashstats/clashstats/settings.py +++ b/clashstats/clashstats/settings.py @@ -128,6 +128,8 @@ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" +CRSF_TRUSTED_ORIGINS = ["clashstats.azurewebsites.net"] + # PWA settings PWA_APP_NAME = 'Clashstats' diff --git a/compose.yaml b/compose.yaml deleted file mode 100644 index 5a471aa..0000000 --- a/compose.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Comments are provided throughout this file to help you get started. -# If you need more help, visit the Docker Compose reference guide at -# https://docs.docker.com/go/compose-spec-reference/ - -# Here the instructions define your application as a service called "server". -# This service is built from the Dockerfile in the current directory. -# You can add other services your application may depend on here, such as a -# database or a cache. For examples, see the Awesome Compose repository: -# https://github.com/docker/awesome-compose -services: - server: - build: - context: . - ports: - - 80:80 - -# The commented out section below is an example of how to define a PostgreSQL -# database that your application can use. `depends_on` tells Docker Compose to -# start the database before your application. The `db-data` volume persists the -# database data between container restarts. The `db-password` secret is used -# to set the database password. You must create `db/password.txt` and add -# a password of your choosing to it before running `docker compose up`. -# depends_on: -# db: -# condition: service_healthy -# db: -# image: postgres -# restart: always -# user: postgres -# secrets: -# - db-password -# volumes: -# - db-data:/var/lib/postgresql/data -# environment: -# - POSTGRES_DB=example -# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password -# expose: -# - 5432 -# healthcheck: -# test: [ "CMD", "pg_isready" ] -# interval: 10s -# timeout: 5s -# retries: 5 -# volumes: -# db-data: -# secrets: -# db-password: -# file: db/password.txt - diff --git a/requirements.txt b/requirements.txt index ffd3a013f95b15565ba09aba3ae97e3d15f5e8bf..d840884b3b480b147b81171295a9faba4194d253 100644 GIT binary patch delta 66 zcmaFBw2XPe5%F|}QieQ+Oon8Je1;+*%N7WY7>p-wSC%bcNCXOJ1Icutf;=Dzku+h@ KV=$a}wHp8{@eh~) delta 13 VcmZ3+{D5h~k%=$FCMz(u0RSqD1*rf4