ignore
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -1,25 +0,0 @@
|
|||||||
FROM python:3.11-slim
|
|
||||||
|
|
||||||
|
|
||||||
ARG USER_UID=1000
|
|
||||||
ARG USER_GID=1000
|
|
||||||
|
|
||||||
# --build-arg USER_GID= USER_UID=
|
|
||||||
RUN groupadd -g "${USER_GID}" flaskuser \
|
|
||||||
&& useradd -u "${USER_UID}" -g "${USER_GID}" flaskuser
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
COPY requirements.txt .
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt gunicorn
|
|
||||||
|
|
||||||
# Copy the rest of the code
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Change ownership to our non-root user
|
|
||||||
RUN chown -R flaskuser:flaskuser /app
|
|
||||||
USER flaskuser
|
|
||||||
|
|
||||||
# Run with Gunicorn (replaces uwsgi)
|
|
||||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app", "--workers", "4"]
|
|
||||||
11
deploy.sh
11
deploy.sh
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
cd content
|
|
||||||
# 1. Save any new comments first
|
|
||||||
git add comments.csv
|
|
||||||
git commit -m "chore: save comments before update"
|
|
||||||
git push origin main
|
|
||||||
|
|
||||||
# 2. Now update the whole blog
|
|
||||||
cd ..
|
|
||||||
git pull
|
|
||||||
git submodule update --init --recursive
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
services:
|
|
||||||
flask_app:
|
|
||||||
build: .
|
|
||||||
container_name: flask_blog
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- .:/app
|
|
||||||
- ./data:/app/data # Persist your CSV files
|
|
||||||
networks:
|
|
||||||
- web_net
|
|
||||||
|
|
||||||
caddy:
|
|
||||||
image: caddy:latest
|
|
||||||
container_name: caddy
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
- "443:443/udp"
|
|
||||||
volumes:
|
|
||||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
||||||
- caddy_data:/data
|
|
||||||
- caddy_config:/config
|
|
||||||
networks:
|
|
||||||
- web_net
|
|
||||||
depends_on:
|
|
||||||
- flask_app
|
|
||||||
|
|
||||||
networks:
|
|
||||||
web_net:
|
|
||||||
driver: bridge
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
caddy_data:
|
|
||||||
caddy_config:
|
|
||||||
Reference in New Issue
Block a user