Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jensk-dev committed Nov 12, 2024
0 parents commit 405a1df
Show file tree
Hide file tree
Showing 9 changed files with 1,956 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM debian:bullseye-slim AS builder

RUN apt-get update && apt-get install -y \
curl \
&& apt-get clean

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --default-toolchain nightly

FROM debian:bullseye-slim

RUN apt-get update && apt-get install -y \
git \
gnupg2 \
build-essential \
pkg-config \
libssl-dev \
&& apt-get clean

# Copy Rust toolchain from the builder stage
COPY --from=builder /root/.cargo /root/.cargo
COPY --from=builder /root/.rustup /root/.rustup

# Set PATH for Rust
ENV PATH="/root/.cargo/bin:${PATH}"

# Confirm installation by showing the Rust version
RUN rustc --version
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "Rust Dev Container",
"build": {
"dockerfile": "Dockerfile"
},
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)|todo!",
"todo-tree.filtering.excludeGlobs": [
"**/.git/**",
"**/.devcontainer/**"
]
},
"extensions": [
"rust-lang.rust-analyzer",
"vadimcn.vscode-lldb",
"tamasfe.even-better-toml",
"fill-labs.dependi",
"usernamehw.errorlens",
"Gruntfuggly.todo-tree",
"ms-azuretools.vscode-docker"
]
}
},
"postCreateCommand": "cargo install --path .",
"forwardPorts": [],
"remoteUser": "root",
"mounts": [
"source=${localWorkspaceFolder},target=/workspace/,type=bind"
]
}
33 changes: 33 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Docker Image to GHCR

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and tag Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/${{ github.repository }}:latest
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
#Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
Loading

0 comments on commit 405a1df

Please sign in to comment.