updating dockerfiles for deployment vs local dev
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 10s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 10s
This commit is contained in:
12
.env.production
Normal file
12
.env.production
Normal file
@@ -0,0 +1,12 @@
|
||||
# SneakySwole Production Environment
|
||||
# Copy to .env on your production server and fill in real values.
|
||||
|
||||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=
|
||||
|
||||
APP_ENV=production
|
||||
APP_HOST=0.0.0.0
|
||||
APP_PORT=8000
|
||||
APP_LOG_LEVEL=warning
|
||||
|
||||
DATABASE_URL=sqlite:///data/sneakyswole.db
|
||||
29
docker-compose.dev.yaml
Normal file
29
docker-compose.dev.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: sneakyswole-dev
|
||||
ports:
|
||||
- "${APP_PORT:-8000}:8000"
|
||||
volumes:
|
||||
- sneakyswole-data:/app/data
|
||||
- ./app:/app/app
|
||||
- ./config:/app/config
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- APP_ENV=development
|
||||
- APP_LOG_LEVEL=debug
|
||||
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
sneakyswole-data:
|
||||
driver: local
|
||||
2
run_dev_docker.sh
Executable file
2
run_dev_docker.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
docker compose -f docker-compose.dev.yaml up --build "$@"
|
||||
Reference in New Issue
Block a user