mirror of
https://github.com/edufeed-org/polloer.git
synced 2025-12-07 23:34:31 +00:00
ci/cd
This commit is contained in:
parent
def118101d
commit
633c6842b7
3 changed files with 53 additions and 0 deletions
27
.github/workflows/docker-publish.yml
vendored
Normal file
27
.github/workflows/docker-publish.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and tag Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ secrets.DOCKER_USERNAME }}/polloer:latest .
|
||||||
|
|
||||||
|
- name: Push to Docker Hub
|
||||||
|
run: |
|
||||||
|
docker push ${{ secrets.DOCKER_USERNAME }}/polloer:latest
|
||||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Schritt 1: Build
|
||||||
|
FROM node:20 AS build
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Schritt 2: Produktionsimage
|
||||||
|
FROM node:20
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=build /app ./
|
||||||
|
# RUN npm prune --production
|
||||||
|
|
||||||
|
EXPOSE 4173
|
||||||
|
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0"]
|
||||||
5
docker-compose.yml
Normal file
5
docker-compose.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
services:
|
||||||
|
svelte-app:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "4173:4173"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue