Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and store YASM Frontend Image

on:
push:
branches:
- task/**
- feature/**
- bug/**
pull_request:
branches:
- main
types:
- opened
- synchronize
- closed

jobs:
build_push_image:
name: Building and storing YASM Frontend Docker Image
uses: necro-cloud/automations/.github/workflows/build-docker-image.yml@main
with:
dev_version_name: development
image_name: frontend
image_proper_name: YASM Frontend
build_path: .
repository: yasm
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
30 changes: 30 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
# global options
admin off
persist_config off
auto_https off
# runtime logs
log {
format json
}
}

# site block, listens on the $PORT environment variable
:{$PORT:3000} {
# access logs
log {
format json # set access log format to json mode
}

# serve from the 'dist' folder (Vite builds into the 'dist' folder)
root * dist

# enable gzipping responses
encode gzip

# serve files from 'dist'
file_server

# if path doesn't exist, redirect it to 'index.html' for client side routing
try_files {path} /index.html
}
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Build stage
FROM denoland/deno:latest as builder

WORKDIR /app
COPY . .

# Build the Solid App
RUN deno install && \
deno task build

# Production stage
FROM caddy

WORKDIR /app

# Copy the Caddyfile and format it
COPY Caddyfile ./
RUN caddy fmt Caddyfile --overwrite

# Copy the built static website
COPY --from=builder /app/dist ./dist

# Port to be used for exposing the site
ENV PORT=5173
EXPOSE 5173

CMD ["caddy", "run", "--config", "Caddyfile", "--adapter", "caddyfile"]