Skip to content

Commit 149112c

Browse files
Feature/update deployment (#60)
* Remove old deployment files * Add docker deployment
1 parent 1636400 commit 149112c

13 files changed

Lines changed: 91 additions & 97 deletions

File tree

.cpanel.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.do/deploy.template.yaml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/ghcr.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: GHCR
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
ghcr:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
15+
steps:
16+
- name: Check out the codebase.
17+
uses: actions/checkout@v4
18+
19+
- name: Login to ghcr.
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Build and push image.
27+
uses: docker/build-push-action@v6
28+
with:
29+
context: docker/
30+
push: true
31+
tags: ghcr.io/PythonVilag/pythonvilag-website:latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Project
2+
secret_key.txt
23
src/pythonvilag_website/static/uploads/*
34

45
# System

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Set basic image data
2+
FROM python:3.12-slim
3+
LABEL org.opencontainers.image.source="https://github.com/PythonVilag/pythonvilag-website"
4+
5+
ENV LANG=C.UTF-8
6+
ENV TZ=Europe/Copenhagen
7+
8+
# Copy files
9+
WORKDIR /workspace
10+
COPY ./requirements.txt ./requirements.txt
11+
COPY ./src/ ./src/
12+
13+
# Install python packages
14+
RUN pip install --upgrade pip && \
15+
pip install -r requirements.txt
16+
17+
# Run command
18+
EXPOSE 5000
19+
CMD ["python", "src/run.py", "--port", "5000"]

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,3 @@ Source code that powers the <a href="https://pythonvilag.hu/" target="_blank">Py
1414

1515
## Deployment
1616
Currently I am hosting this website on [mikrovps](https://www.mikrovps.net/hu).
17-
18-
Previously I was experimenting with hosting on [digitalocean](https://www.digitalocean.com/).\
19-
The following link can be used to deploy the website and to use my referral code. (Keep in mind that during the deployment some environment variables need to be set.)
20-
21-
<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/PythonVilag/pythonvilag-website/tree/main&refcode=f2cb42a82894" target="_blank">
22-
<img src="https://www.deploytodo.com/do-btn-white.svg" alt="deploy">
23-
</a>

compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
services:
3+
pythonvilag-website:
4+
image: ghcr.io/PythonVilag/pythonvilag-website:latest
5+
container_name: pythonvilag-website
6+
hostname: pythonvilag-website
7+
ports:
8+
- "5000:5000"
9+
environment:
10+
- SECRET_KEY=/run/secrets/secret_key
11+
secrets:
12+
- secret_key
13+
14+
secrets:
15+
secret_key:
16+
file: secret_key.txt

gunicorn_config.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

requirements.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
.
1+
Flask-SQLAlchemy==3.1.1
2+
Flask-WTF==1.2.1
3+
Flask==3.0.3
4+
gunicorn==23.0.0
5+
itsdangerous==2.2.0
6+
python-dotenv==1.0.1
7+
SQLAlchemy==2.0.32
8+
Werkzeug==3.0.3
9+
# Self maintained
10+
# private-lecture-automation==0.2.0
11+
# checkmark==0.1.0

0 commit comments

Comments
 (0)