coreapp new --postgres: apps with their own database
A template overlay (templates/postgres) adds DEPENDS="postgresql", DB_* settings with a random password, an install that creates the user and database on the Core's PostgreSQL (safe to re-run), an uninstall that drops them, and a Python example that counts visits. Tested with a throwaway app: deploy, redeploy and a reboot of the Core keep the data, remove drops the database and user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# The app's image. coreapp deploy builds it as coreapp/{{NAME}}:<VERSION>
|
||||
# and copies it to the Core. Replace this with your own app; keep it
|
||||
# listening on the port in docker-compose.yml.in (8080).
|
||||
FROM python:3.13-slim
|
||||
RUN pip install --no-cache-dir "psycopg[binary]==3.2.*"
|
||||
COPY app.py /app/app.py
|
||||
USER nobody
|
||||
EXPOSE 8080
|
||||
CMD ["python", "-u", "/app/app.py"]
|
||||
Reference in New Issue
Block a user