-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
162 changed files
with
108 additions
and
17,609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.github/ | ||
**/.vscode/ | ||
docs/ | ||
frontend/node_modules/ | ||
internal/app/api/core/frontend-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
groups: | ||
actions: | ||
patterns: | ||
- "*" | ||
|
||
- package-ecosystem: gomod | ||
directory: / | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,60 @@ | ||
# Dockerfile References: https://docs.docker.com/engine/reference/builder/ | ||
# This dockerfile uses a multi-stage build system to reduce the image footprint. | ||
|
||
######- | ||
# Start from the latest golang base image as builder image (only used to compile the code) | ||
######- | ||
FROM golang:1.21 as builder | ||
|
||
ARG BUILD_IDENTIFIER | ||
ENV ENV_BUILD_IDENTIFIER=$BUILD_IDENTIFIER | ||
|
||
ARG BUILD_VERSION | ||
ENV ENV_BUILD_VERSION=$BUILD_VERSION | ||
|
||
# populated by BuildKit | ||
ARG TARGETPLATFORM | ||
ENV ENV_TARGETPLATFORM=$TARGETPLATFORM | ||
|
||
RUN mkdir /build | ||
|
||
# Copy the source from the current directory to the Working Directory inside the container | ||
ADD . /build/ | ||
|
||
# Set the Current Working Directory inside the container | ||
###### | ||
# Build frontend | ||
###### | ||
FROM --platform=${BUILDPLATFORM} node:lts-alpine as frontend | ||
# Set the working directory | ||
WORKDIR /build | ||
|
||
# Build the Go app | ||
RUN echo "Building version '$ENV_BUILD_IDENTIFIER-$ENV_BUILD_VERSION' for platform $ENV_TARGETPLATFORM"; make build | ||
|
||
######- | ||
# Here starts the main image | ||
######- | ||
# Download dependencies | ||
COPY frontend/package.json frontend/package-lock.json ./ | ||
RUN npm ci | ||
# Set dist output directory | ||
ENV DIST_OUT_DIR="dist" | ||
# Copy the sources to the working directory | ||
COPY frontend . | ||
# Build the frontend | ||
RUN npm run build | ||
|
||
###### | ||
# Build backend | ||
###### | ||
FROM --platform=${BUILDPLATFORM} golang:1.21-alpine as builder | ||
# Set the working directory | ||
WORKDIR /build | ||
# Download dependencies | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
# Copy the sources to the working directory | ||
COPY . . | ||
# Copy the frontend build result | ||
COPY --from=frontend /build/dist/ ./internal/app/api/core/frontend-dist/ | ||
# Set the build version from arguments | ||
ARG BUILD_VERSION | ||
# Split to cross-platform build | ||
ARG TARGETARCH | ||
# Build the application | ||
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -o /build/dist/wg-portal \ | ||
-ldflags "-w -s -extldflags '-static' -X 'github.com/h44z/wg-portal/internal.Version=${BUILD_VERSION}'" \ | ||
-tags netgo \ | ||
cmd/wg-portal/main.go | ||
|
||
###### | ||
# Final image | ||
###### | ||
FROM alpine:3.19 | ||
|
||
# Install OS-level dependencies | ||
RUN apk add --no-cache bash openresolv | ||
|
||
RUN apk add --no-cache bash curl iptables nftables openresolv | ||
# Setup timezone | ||
ENV TZ=Europe/Vienna | ||
|
||
# Copy binaries | ||
COPY --from=builder /build/dist/wg-portal /app/wg-portal | ||
|
||
# Set the Current Working Directory inside the container | ||
WORKDIR /app | ||
|
||
# by default, the web-portal is reachable on port 8888 | ||
EXPOSE 8888/tcp | ||
|
||
# the database and config file can be mounted from the host | ||
VOLUME [ "/app/data", "/app/config" ] | ||
|
||
# Command to run the executable | ||
ENTRYPOINT [ "/app/wg-portal" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
internal/app/api/core/frontend-dist/assets/ProfileView-7h9_sssB.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
internal/app/api/core/frontend-dist/assets/UserView-s51HLNTa.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.