Skip to content

Commit

Permalink
Adding build container (#220)
Browse files Browse the repository at this point in the history
This commit adds a build container to make it easier for people without
NodeJS/npm to run the website locally.

Signed-off-by: Janos Bonic <[email protected]>
  • Loading branch information
Janos authored Nov 29, 2023
1 parent 0e17a36 commit 80f7dbf
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:18

WORKDIR /work
COPY package.json /work
COPY package-lock.json /work
RUN npm i

CMD ["npm", "run", "start", "--", "--host","0.0.0.0"]
35 changes: 27 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,48 @@
- TypeScript
- Tailwind CSS

## Getting Started
## Working with this repository

1. Clone the repository
### Cloning the repository

This repository uses git submodules to pull in the [main OpenTofu repository](https://github.com/opentofu/opentofu).
You can clone it using the following two steps:

1. Clone the repository:

```bash
git clone [email protected]:opentofu/opentofu.org.git
```

2. Install dependencies
2. Fetch the documentation:

```bash
npm i
git submodule init
git submodule update
```

3. Fetch the documentation
### Running the dev server locally

You can run the dev server if you have a local NodeJS/npm environment installed:

1. Install dependencies:

```bash
git submodule init
git submodule update
npm i
```

4. Start the development server
2. Start the development server:

```bash
npm run start
```

You can now access the site locally at http://localhost:3000/

### Running the dev server in a container

You can also run the dev server in a container with the following command:

```bash
docker compose up --build
```
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.8'
services:
website:
build: .
volumes:
- source: ./
target: /work
type: bind
- /work/node_modules
ports:
- "3000:3000"

0 comments on commit 80f7dbf

Please sign in to comment.