Skip to content

Instantly share code, notes, and snippets.

View ptrxyz's full-sized avatar

ptrxyz ptrxyz

View GitHub Profile
@link = if Rails.env.production?
"#{(ENV['URL_USE_SSL'] == 1 || ENV['URL_USE_SSL'] == 'true') && 'https' || 'http'}://#{ENV['URL_HOST'] || ENV['HOST'] || ENV['SMTP_DOMAIN']}/zip/#{job_id}.#{extname}"
else
"http://#{ENV['URL_HOST'] || ENV['HOST'] || 'localhost:3000'}/zip/#{job_id}.#{extname}"
end
@ptrxyz
ptrxyz / app.py
Last active April 11, 2022 01:04
Docker Workshop App1
#!/usr/bin/env python3
from flask import Flask
import os
app = Flask(__name__)
class EnvNotSetError(Exception):
def __repr__(self):
return "EnvNotSetException was raised."
pass
@ptrxyz
ptrxyz / Dockerfile
Created April 11, 2022 01:20
Docker workshop 2
FROM ubuntu
RUN apt update -y && apt install -y python3 python3-pip && pip install flask
ENV APPCONFIG=/app/config.msg
ADD config.msg /app/config.msg
ADD app2.py /app/app.py
WORKDIR /app
@ptrxyz
ptrxyz / Dockerfile
Created April 11, 2022 01:28
Docker Workshop 3
FROM python:3.7-alpine
RUN apk add --no-cache gcc musl-dev linux-headers
...add files, set env, install stuff, etc...
RUN pip install -r requirements.txt
...add files, set env, install stuff, etc...
CMD python app.py
@ptrxyz
ptrxyz / Dockerfile
Created April 11, 2022 13:25
Docker Workshop, basic.
FROM ubuntu
RUN apt update -y && apt install -y python3 python3-pip && pip install flask
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Nimbus Roman</family>
</prefer>
</alias>