Browse Source

add kanico and badges

master
An Pham 8 months ago
parent
commit
1edbe7f6c3
6 changed files with 90 additions and 0 deletions
  1. +4
    -0
      README.md
  2. +27
    -0
      kanico/data/Dockerfile
  3. +4
    -0
      kanico/data/requirements.txt
  4. +28
    -0
      kanico/pod.yml
  5. +13
    -0
      kanico/volume-claim.yaml
  6. +14
    -0
      kanico/volume.yaml

+ 4
- 0
README.md View File

@ -0,0 +1,4 @@
![Docker Pulls](https://img.shields.io/docker/pulls/phamduchongan93/virtualporfolio)
# Overview
- Virtual Bussiness Card.

+ 27
- 0
kanico/data/Dockerfile View File

@ -0,0 +1,27 @@
# Use the official Python image as base
FROM python:3.9-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire application into the container
COPY . .
# Create a volume for static files
VOLUME /app/static
# Expose the port the app runs on
EXPOSE 5000
# Command to run the application
CMD python3 app.py

+ 4
- 0
kanico/data/requirements.txt View File

@ -0,0 +1,4 @@
Flask==2.0.1
qrcode==7.3
Pillow==8.3.1
Werkzeug==2.0.1

+ 28
- 0
kanico/pod.yml View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: Pod
metadata:
name: virtualcard
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: [
"--dockerfile=./Dockerfile",
"--context=dir:///workspace/",
"--destination=phamduchongan93/virtualporfolio"] # replace with your dockerhub account
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker
- name: dockerfile-storage
mountPath: /workspace
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: regcred
items:
- key: .dockerconfigjson
path: config.json
- name: dockerfile-storage
persistentVolumeClaim:
claimName: dockerfile-virtualporfolio-claim

+ 13
- 0
kanico/volume-claim.yaml View File

@ -0,0 +1,13 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: dockerfile-virtualporfolio-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
storageClassName: manual
volumeMode: Filesystem
volumeName: virtual-porfolio-pv

+ 14
- 0
kanico/volume.yaml View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: virtual-porfolio-pv
labels:
type: local
spec:
capacity:
storage: 15Gi
accessModes:
- ReadWriteOnce
storageClassName: manual
hostPath:
path: /home/ubuntu/virtualporfolio/kanico/data # replace with local directory, such as "/home/<user-name>/kaniko"

Loading…
Cancel
Save