Skip to content

Instantly share code, notes, and snippets.

View thomascenni's full-sized avatar

Thomas Cenni thomascenni

View GitHub Profile
{
"schemaVersion": 2,
"dockerfilePath": "Dockerfile"
}
FROM tiangolo/meinheld-gunicorn:python3.7-alpine3.8
RUN mkdir -p /app
RUN mkdir -p /usr/src/static
RUN mkdir -p /usr/src/data
WORKDIR /app
COPY ./ /app
RUN pip install -r requirements.txt
#! /usr/bin/env bash
# Run collect static and migrations
python manage.py collectstatic --noinput
python manage.py migrate
{
"captainVersion": "2",
"documentation": "Taken from https://github.com/thomascenni/djcap",
"displayName": "DjCap",
"description": "Deploy a Django application with Caprover PaaS.",
"dockerCompose": {
"version": "2",
"services": {
"$$cap_appname": {
"image": "alpine:3.8",
@thomascenni
thomascenni / dfToexcel.py
Last active April 17, 2023 01:16
Return Excel file from Pandas Dataframe in Django
import pandas as pd
from io import BytesIO
from django.http import HttpResponse
# suppose to have a Dataframe object
# inside a Django view
df = pd.DataFrame(...)
with BytesIO() as b:
# Use the StringIO object as the filehandle.
#!/bin/bash
php -v
curl -LO https://cecil.app/cecil.phar
chmod +x cecil.phar
./cecil.phar -V
./cecil.phar new:site mywebsite
cd mywebsite
# add a blog page
../cecil.phar new:page blog/my-first-post.md
@thomascenni
thomascenni / composer.json
Created October 13, 2020 00:49
mPDF Example
{
"require": {
"mpdf/mpdf": "^8.0"
}
}
captainVersion: 4
services:
$$cap_appname-mail:
image: bytemark/smtp
restart: always
environment:
RELAY_HOST: $$cap_RELAY_HOST
RELAY_PORT: $$cap_RELAY_PORT
RELAY_USERNAME: $$cap_RELAY_USERNAME
@thomascenni
thomascenni / invoiceninja5.yml
Last active November 4, 2021 13:04
InvoiceNinja one-click app for Caprover (work in progress)
captainVersion: 4
services:
$$cap_appname-db:
image: mysql:5.7.32
restart: always
environment:
MYSQL_ROOT_PASSWORD: $$cap_db_root_password
MYSQL_DATABASE: ninja
MYSQL_USER: invoiceninja
{
"Statement": [{
"Action": ["s3:GetBucketLocation", "s3:ListBucket"],
"Effect": "Allow",
"Principal": {
"AWS": ["*"]
},
"Resource": ["arn:aws:s3:::job-offers"]
}, {
"Action": ["s3:GetObject"],