liubing 3 nedēļas atpakaļ
revīzija
4ea0b7078f
9 mainītis faili ar 87 papildinājumiem un 0 dzēšanām
  1. 3 0
      .gitignore
  2. 8 0
      .idea/.gitignore
  3. 6 0
      .idea/inspectionProfiles/Project_Default.xml
  4. 8 0
      .idea/modules.xml
  5. 9 0
      .idea/obadmin.iml
  6. 6 0
      .idea/vcs.xml
  7. 23 0
      Dockerfile
  8. 24 0
      Makefile
  9. 0 0
      README.md

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.venv
+*.pyc
+poetry.lock

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 6 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
+  </profile>
+</component>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/obadmin.iml" filepath="$PROJECT_DIR$/.idea/obadmin.iml" />
+    </modules>
+  </component>
+</project>

+ 9 - 0
.idea/obadmin.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="Go" enabled="true" />
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 23 - 0
Dockerfile

@@ -0,0 +1,23 @@
+FROM reg.home.base/yawyd/py310
+
+COPY static /app/static
+RUN mkdir /app/media
+
+RUN apt update -qq && apt install -y -qq nginx
+COPY deploy/nginx.conf /etc/nginx/
+
+COPY . /app
+
+COPY ./deploy/zengarden-cron /etc/cron.d/zengarden-cron
+RUN chmod 0644 /etc/cron.d/zengarden-cron
+RUN crontab /etc/cron.d/zengarden-cron
+RUN touch /var/log/cron.log
+
+WORKDIR /app
+
+RUN poetry config virtualenvs.in-project true
+RUN poetry install -q
+
+EXPOSE 80
+
+CMD ["./deploy/start.sh"]

+ 24 - 0
Makefile

@@ -0,0 +1,24 @@
+tag=reg.home.base/yawyd/zengarden
+
+run-jobs:
+	python manage.py runcrons
+
+update-dep:
+	poetry lock --no-update
+	poetry install --no-root
+
+docker-build:
+	docker build . -t ${tag}
+
+docker-run:
+	docker run --name zengarden --rm -i -p 3380:80 -p 3388:8080 ${tag}
+
+docker-push: docker-build
+	docker push ${tag}
+
+docker-clean:
+	docker image rm ${tag}
+
+deploy:
+	kubectl apply -f k8s/k8s.yaml
+	kubectl rollout restart deployment zengarden -n home

+ 0 - 0
README.md