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
21 changes: 21 additions & 0 deletions .github/workflows/exesh.deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: FrontendDeploy
on:
push:
branches:
- master

jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: docker.io/eewynell/coduels-frontend:latest
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:24-slim AS builder

RUN npm i -g pnpm

WORKDIR /app

COPY package.json pnpm-lock.yaml ./

RUN pnpm i

COPY src src
COPY public public
COPY *.ts *.js *.json *.yaml *.yml *.html ./

ARG VITE_BASE_URL=/api
ENV VITE_BASE_URL=${VITE_BASE_URL}

RUN pnpm build

FROM nginx:alpine-slim

COPY ./nginx.conf /etc/nginx/nginx.conf

COPY --from=builder /app/dist/ /var/www

11 changes: 11 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
http {
server {
include mime.types;
listen 8080;
root /var/www;
try_files $uri $uri/ /index.html;
}
}

events {}

3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import svgr from "vite-plugin-svgr";

// https://vite.dev/config/
export default defineConfig({
build: {
sourcemap: true,
},
plugins: [react(), svgr()],
server: {
host: "127.0.0.1",
Expand Down