Menu

1 / 2

Securely Deploying an SQLite Database to a Docker Container with

DEV Community·Mustafa ERBAY·6 months ago
#OEspjpJn
Reading 0:00
15s threshold

Guide to Securely Deploying an SQLite Database to a Docker Container with GitHub Actions

I remember my VPS disk filling up to 100% on April 28th, but in this post, I'm sharing a guide on securely deploying an SQLite database to a Docker container using GitHub Actions.

Security Definition

Before deploying the database, we must define security. We will do this definition in the Dockerfile and the YAML file we will use to deploy to the container.

# Dockerfile FROM python:3.9-slim

# SQLite installation RUN apt-get update && apt-get install -y sqlite3

# SQLite database creation RUN sqlite3 /db.sqlite3 < /schema.sql

# Our database file to be deployed to the container COPY database.db /db.sqlite3

Enter fullscreen mode

Exit fullscreen mode

GitHub Actions Guide

Let's create the YAML file that enables us to deploy to the container using GitHub Actions.

# .github/workflows/deploy.yml name : Deploy SQLite Database

on : push : branches : - main

jobs : deploy : runs-on : ubuntu-latest steps : - name :…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.