docker
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 34s

This commit is contained in:
Shihaam Abdul Rahman 2025-01-11 01:13:03 +05:00
parent cada3ce412
commit 09e7c410a8
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636
7 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,5 @@
FROM node:18
WORKDIR /var/www/html
CMD npm run dev

View File

@ -0,0 +1,5 @@
FROM node:18
WORKDIR /var/www/html
CMD npx prisma studio

12
.build/prod/README.md Normal file
View File

@ -0,0 +1,12 @@
### Docker/Podman compose.yml
```yml
services:
sarlinkportal:
image: git.shihaam.dev/sarlink/sarlink-portal
hostname: sarlink-portal
ports:
- 3000:3000
# volumes:
# - uploads:/var/www/html/public/uploads
env_file: .env
```

View File

@ -0,0 +1,18 @@
FROM oven/bun:1.1.42-debian AS builder
WORKDIR /var/www/html
ENV NEXT_TELEMETRY_DISABLED=1
COPY . .
RUN bun install --frozen-lockfile
RUN bunx prisma generate
RUN bun run build
FROM oven/bun:1.1.42-debian
WORKDIR /var/www/html
COPY --from=builder /var/www/html/package.json ./
COPY --from=builder /var/www/html/node_modules ./node_modules
COPY --from=builder /var/www/html/.next ./.next
COPY --from=builder /var/www/html/public ./public
COPY --from=builder /var/www/html/prisma ./prisma
VOLUME /var/www/html
CMD ["bun", "start"]

13
.build/prod/compose.yml Normal file
View File

@ -0,0 +1,13 @@
services:
app:
build:
context: ../../
dockerfile: .build/prod/bun.Dockerfile
hostname: sarlink-portal
image: git.shihaam.dev/sarlink/sarlink-portal/app
prisma-studio:
build:
context: .
dockerfile: ./prisma.Dockerfile
hostname: sarlink-portal-database-ui
image: git.shihaam.dev/sarlink/sarlink-portal/prisma-studio

View File

@ -0,0 +1,5 @@
FROM oven/bun:1.1.42-debian
WORKDIR /var/www/html
CMD bunx prisma studio

View File

@ -0,0 +1,37 @@
name: Build and Push Docker Images
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
docker:
name: Build and Push Docker Images
runs-on: builder
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Docker images
working-directory: .build/prod
run: docker compose build
- name: Login to Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ vars.DOCKER_REGISTRY_URL }}
username: ${{ vars.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Push Docker images
if: github.event_name != 'pull_request'
working-directory: .build/prod
run: docker compose push