@ -0,0 +1,4 @@ | |||||
![Docker Pulls](https://img.shields.io/docker/pulls/phamduchongan93/virtualporfolio) | |||||
# Overview | |||||
- Virtual Bussiness Card. |
@ -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 |
@ -0,0 +1,4 @@ | |||||
Flask==2.0.1 | |||||
qrcode==7.3 | |||||
Pillow==8.3.1 | |||||
Werkzeug==2.0.1 |
@ -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 |
@ -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 |
@ -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" |