Skip to content

Commit

Permalink
chore: deploy (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed May 9, 2024
1 parent 6dd71ab commit ced2428
Show file tree
Hide file tree
Showing 16 changed files with 1,866 additions and 1,790 deletions.
1 change: 1 addition & 0 deletions .dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TZ=Europe/Brussels
DATA_DIR="./data"
BACKEND_DIR="./backend"
FRONTEND_DIR="./frontend"
DOCS_DIR="./docs"
SSL_DIR="./data/nginx/ssl"

# Redis
Expand Down
1 change: 1 addition & 0 deletions .prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TZ=Europe/Brussels
DATA_DIR="./data"
BACKEND_DIR="./backend"
FRONTEND_DIR="./frontend"
DOCS_DIR="./docs"
SSL_DIR=""

# Postgress DB
Expand Down
13 changes: 13 additions & 0 deletions data/nginx/nginx.dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ http {
server frontend:443;
}

upstream docs {
server docs:5173;
}

server {
listen 80;
listen [::]:80;
Expand Down Expand Up @@ -58,6 +62,15 @@ http {
proxy_set_header Host $host;
}

location /docs/ {
proxy_pass http://docs$request_uri;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

location / {
proxy_pass http://frontend;
Expand Down
11 changes: 11 additions & 0 deletions data/nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ http {
server frontend:3000;
}

upstream docs {
server docs:3000;
}

server {
listen 80;
listen [::]:80;
Expand All @@ -34,6 +38,13 @@ http {
proxy_redirect off;
}

location /docs/ {
proxy_pass http://docs$request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

location / {
proxy_pass http://frontend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
10 changes: 10 additions & 0 deletions development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ services:
depends_on:
- backend

docs:
<<: *common-keys-selab
container_name: docs
build:
context: $DOCS_DIR
dockerfile: Dockerfile.dev
command: sh -c "npm install && npm run host"
volumes:
- ${DOCS_DIR}:/docs

redis:
<<: *common-keys-selab
container_name: redis
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
69 changes: 35 additions & 34 deletions docs/.vitepress/config.mts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
import { defineConfig } from 'vitepress'
import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
locales: {
root: {
label: 'English',
lang: 'en',
link: '/en'
base: "/docs",
locales: {
root: {
label: "English",
lang: "en",
link: "/en",
},
nl: {
label: "Nederlands",
lang: "nl",
link: "/nl",
},
},
nl: {
label: 'Nederlands',
lang: 'nl',
link: '/nl'
}
},
title: "Ypovoli",
description: "A ugent site",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
// { text: 'Home', link: '/en/' },
// { text: 'Examples', link: '/markdown-examples' }
],
title: "Ypovoli",
description: "A ugent site",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
// { text: 'Home', link: '/en/' },
// { text: 'Examples', link: '/markdown-examples' }
],

sidebar: [
{
text: 'Algemeen',
items: [
// { text: 'Markdown Examples', link: '/markdown-examples' },
// { text: 'Runtime API Examples', link: '/api-examples' }
]
}
],
sidebar: [
{
text: "Algemeen",
items: [
// { text: 'Markdown Examples', link: '/markdown-examples' },
// { text: 'Runtime API Examples', link: '/api-examples' }
],
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/SELab-2/UGent-7' }
]
}
})
socialLinks: [
{ icon: "github", link: "https://github.com/SELab-2/UGent-7" },
],
},
});
7 changes: 7 additions & 0 deletions docs/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:18.17.1-alpine3.17

WORKDIR /docs

COPY package*.json ./

RUN npm install
12 changes: 12 additions & 0 deletions docs/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:18.17.1-alpine3.17 as build-stage
WORKDIR /docs
COPY package*.json ./
RUN npm install
COPY ./ .
RUN npm run build

FROM nginx:alpine-slim as production-stage
EXPOSE 3000
RUN mkdir /docs
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /docs/.vitepress/dist /docs
9 changes: 9 additions & 0 deletions docs/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server {
listen 3000;

location / {
root /docs;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
Loading

0 comments on commit ced2428

Please sign in to comment.