website: Dev server (#971)

Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com>
This commit is contained in:
Janos 2023-12-05 14:01:53 +01:00 committed by GitHub
parent 644d8afdb0
commit a27f1b48ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 0 deletions

26
.github/workflows/website.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Website checks
on:
pull_request:
push:
branches:
- main
- 'v[0-9]+.[0-9]+'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare website container
run: docker compose -f docker-compose.build.yml build
working-directory: website
- name: Build website
run: docker compose -f docker-compose.build.yml up --exit-code-from website
working-directory: website

14
website/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM alpine AS parent
RUN apk add git
RUN git clone https://github.com/opentofu/opentofu.org /work
FROM node
COPY --from=parent /work /work
WORKDIR /work
RUN npm i
VOLUME /work/opentofu-repo
EXPOSE 3000
CMD ["npm", "run", "start", "--", "--host","0.0.0.0"]

View File

@ -2,6 +2,16 @@
This directory contains the portions of [the OpenTofu website](https://opentofu.org) that pertain to the core functionality, excluding providers and the overall configuration.
## Development server
You can start a local development server with Docker by running the following command from this (the `website`) directory:
```
docker compose up --build
```
The development server will be available on http://localhost:3000/ .
## Suggesting Changes
You can [submit an issue](https://github.com/opentofu/opentofu/issues/new/choose) with documentation requests or submit a pull request with suggested changes.

View File

@ -0,0 +1,13 @@
version: '3.8'
services:
website:
build: .
ports:
- "3000:3000"
volumes:
- ../:/work/opentofu-repo
command:
- npm
- run
- build
restart: no

View File

@ -0,0 +1,8 @@
version: '3.8'
services:
website:
build: .
ports:
- "3000:3000"
volumes:
- ../:/work/opentofu-repo