Add Dockerfiles and Gitea CI workflow
This commit is contained in:
parent
c4439e76a8
commit
9a40854884
|
|
@ -0,0 +1,38 @@
|
|||
name: Build and Deploy Chitfund
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build and push Backend
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./backend
|
||||
push: true
|
||||
tags: 192.168.8.250:5000/chitfund-backend:latest
|
||||
# Local registry is insecure
|
||||
labels: |
|
||||
org.opencontainers.image.source=${{ gitea.repository_url }}
|
||||
|
||||
build-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build and push Frontend
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./luckychit
|
||||
push: true
|
||||
tags: 192.168.8.250:5000/chitfund-frontend:latest
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# Backend Dockerfile for Chitfund
|
||||
FROM node:20-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install build essentials for bcrypt if needed (though pre-built binaries usually work on slim)
|
||||
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "start"]
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# Frontend Dockerfile for Chitfund (Flutter Web)
|
||||
FROM node:20-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# We serve the build/web directory.
|
||||
# NOTE: This Dockerfile assumes you have already run 'flutter build web'
|
||||
# or we will use a multi-stage build if you prefer.
|
||||
# For simplicity in this home lab, we copy the build output.
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install express
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["node", "web-server.js"]
|
||||
Loading…
Reference in New Issue