Skip to content

Commit dcf814a

Browse files
committed
ADD: local deploy
1 parent 6c86823 commit dcf814a

File tree

7 files changed

+649
-0
lines changed

7 files changed

+649
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# DevContainer per sviluppo locale identico a GitHub Actions
2+
FROM ubuntu:22.04
3+
4+
# Evita domande interattive
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Installa dipendenze di sistema
8+
RUN apt-get update && \
9+
apt-get install -y curl wget git ca-certificates build-essential gnupg lsb-release unzip && \
10+
rm -rf /var/lib/apt/lists/*
11+
12+
# Installa Go (necessario per hugo modules)
13+
ENV GO_VERSION=1.22.3
14+
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
15+
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
16+
rm go${GO_VERSION}.linux-amd64.tar.gz
17+
ENV PATH="/usr/local/go/bin:${PATH}"
18+
19+
# Installa Node.js (LTS) e npm
20+
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
21+
apt-get install -y nodejs && \
22+
npm install -g npm@latest
23+
24+
25+
# Installa Hugo extended (sceglie architettura corretta)
26+
ENV HUGO_VERSION=0.136.5
27+
RUN ARCH=$(uname -m) && \
28+
if [ "$ARCH" = "x86_64" ]; then \
29+
HUGO_ARCH=amd64; \
30+
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
31+
HUGO_ARCH=arm64; \
32+
else \
33+
echo "Unsupported architecture: $ARCH" && exit 1; \
34+
fi && \
35+
wget -O hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz && \
36+
tar -xzvf hugo.tar.gz -C /usr/local/bin hugo && \
37+
rm hugo.tar.gz
38+
39+
# Installa pagefind come dipendenza globale (opzionale, ma utile per debug)
40+
RUN npm install -g pagefind
41+
42+
# Crea utente non-root per VS Code
43+
RUN useradd -m vscode
44+
USER vscode
45+
WORKDIR /workspace
46+
47+
# Consigliato: copia package.json/package-lock.json se presenti per caching
48+
# COPY package*.json ./
49+
# RUN npm install
50+
51+
# Esporta porta per hugo server
52+
EXPOSE 1313

.devcontainer/devcontainer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "HugoBlox DevContainer",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"workspaceFolder": "/workspace",
7+
"forwardPorts": [1313],
8+
"customizations": {
9+
"vscode": {
10+
"settings": {
11+
"terminal.integrated.defaultProfile.linux": "bash"
12+
}
13+
}
14+
},
15+
"remoteUser": "vscode",
16+
"features": {},
17+
"mounts": [
18+
"source=${localWorkspaceFolder},target=/workspace,type=bind"
19+
],
20+
"containerEnv": {
21+
"HUGO_ENVIRONMENT": "production"
22+
}
23+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
public/
2+
resources/

.hugo_build.lock

Whitespace-only changes.

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-netlify v1.1.2-0.20231209203044-d31adfedd40b h1:rAluI3a9m5ZoJY5xTF7YcgA4YTJLsvPTEh6sVQhPb+o=
2+
github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-netlify v1.1.2-0.20231209203044-d31adfedd40b/go.mod h1:C7jfxMLv1bEUqbM9XDSmEpfOpS8w06OgqNDEcbuRgL4=
3+
github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.3.1 h1:x2rcz2S0TTfkMVyd9dhQSStUecuE4t6c7hw1IrYJYHI=
4+
github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.3.1/go.mod h1:bUQKSt1XQhk60nSpI6D+MibQi6v8s7HghF5qoAtlhws=

0 commit comments

Comments
 (0)