Skip to content

Commit

Permalink
Dockerfile for server
Browse files Browse the repository at this point in the history
  • Loading branch information
cordx56 committed Nov 5, 2024
1 parent 5b83c16 commit 5680867
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release RustOwl

on:
push:
tags:
- v*

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@V4

# Setup Docker
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
uses: docker/login-action@3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v6
with:
push: true
context: rustowl-server
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
52 changes: 49 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,56 @@
# RustOwl

## Manually build
## Quick Start



## Manually Build

### HTTP server

#### Prerequisite

- `rustup` installed
- You can install `rustup` from [this link](https://rustup.rs/).

This has been tested on macOS Sonoma 14.6.1 with `rustup` 1.27.1.
Other dependencies are locked in the configuration files and will be installed automatically.

We have also tested this on Ubuntu 24.04.1 with rustup 1.27.1.

Additional dependencies may be required.
We have confirmed that running `apt install -y build-essential` is necessary on a freshly installed Ubuntu for linking.

#### Build & Run

```bash
cd rustowl-server
cargo run
```


### Visual Studio Code (VSCode) extension

#### Prerequisite

- VSCode installed
- You can install VSCode from [this link](https://code.visualstudio.com/).
- Node.js installed
- `yarn` installed
- You can install `yarn` by running `npm install -g yarn`.

This has been tested on macOS Sonoma 14.6.1 with Visual Studio Code 1.95.1, nodejs v20.16.0, and `yarn` 1.22.22.
Other dependencies are locked in the configuration files and will be installed automatically.

#### Build & Run

First, install the dependencies, then open VSCode.

```bash
rustup component add rust-src rustc-dev llvm-tools-preview
cargo build --release
cd rustowl-vscode
yarn install --frozen-locked
code .
```

Press the `F5` key in the open VSCode window.
A new VSCode window with the extension enabled will appear.
1 change: 1 addition & 0 deletions rustowl-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
8 changes: 8 additions & 0 deletions rustowl-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM rust:1-slim-bookworm AS builder

WORKDIR /app
COPY . .

RUN cargo build --release --locked

ENTRYPOINT ["cargo", "run", "--release"]

0 comments on commit 5680867

Please sign in to comment.