docker
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 34s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 34s
This commit is contained in:
parent
cada3ce412
commit
09e7c410a8
5
.build/dev/node.Dockerfile
Normal file
5
.build/dev/node.Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM node:18
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
CMD npm run dev
|
5
.build/dev/prisma.Dockerfile
Normal file
5
.build/dev/prisma.Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM node:18
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
CMD npx prisma studio
|
12
.build/prod/README.md
Normal file
12
.build/prod/README.md
Normal 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
|
||||
```
|
18
.build/prod/bun.Dockerfile
Normal file
18
.build/prod/bun.Dockerfile
Normal 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
13
.build/prod/compose.yml
Normal 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
|
5
.build/prod/prisma.Dockerfile
Normal file
5
.build/prod/prisma.Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM oven/bun:1.1.42-debian
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
CMD bunx prisma studio
|
37
.gitea/workflows/docker-build.yml
Normal file
37
.gitea/workflows/docker-build.yml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user