mirror of
https://github.com/h44z/wg-portal
synced 2025-06-26 18:16:21 +00:00
Update Dockerfile
- Fix FromAsCasing - Copy `cmd` and `internal` directories only for backend
This commit is contained in:
parent
a46dabc1d3
commit
57c8648fea
@ -1,5 +1,14 @@
|
|||||||
.github/
|
# Ignore everything
|
||||||
**/.vscode/
|
*
|
||||||
docs/
|
|
||||||
frontend/node_modules/
|
# Allow backend files
|
||||||
internal/app/api/core/frontend-dist
|
!cmd/
|
||||||
|
!internal/
|
||||||
|
!go.mod
|
||||||
|
!go.sum
|
||||||
|
|
||||||
|
# Allow frontend files
|
||||||
|
!frontend/
|
||||||
|
|
||||||
|
# Ignore node_modules
|
||||||
|
**/node_modules/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
######
|
######
|
||||||
# Build frontend
|
# Build frontend
|
||||||
######
|
######
|
||||||
FROM --platform=${BUILDPLATFORM} node:lts-alpine as frontend
|
FROM --platform=${BUILDPLATFORM} node:lts-alpine AS frontend
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
# Download dependencies
|
# Download dependencies
|
||||||
@ -20,14 +20,15 @@ RUN npm run build
|
|||||||
######
|
######
|
||||||
# Build backend
|
# Build backend
|
||||||
######
|
######
|
||||||
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine as builder
|
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine AS builder
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
# Download dependencies
|
# Download dependencies
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
# Copy the sources to the working directory
|
# Copy the sources to the working directory
|
||||||
COPY . .
|
COPY ./cmd ./cmd
|
||||||
|
COPY ./internal ./internal
|
||||||
# Copy the frontend build result
|
# Copy the frontend build result
|
||||||
COPY --from=frontend /build/dist/ ./internal/app/api/core/frontend-dist/
|
COPY --from=frontend /build/dist/ ./internal/app/api/core/frontend-dist/
|
||||||
# Set the build version from arguments
|
# Set the build version from arguments
|
||||||
@ -47,7 +48,7 @@ FROM alpine:3.19
|
|||||||
# Install OS-level dependencies
|
# Install OS-level dependencies
|
||||||
RUN apk add --no-cache bash curl iptables nftables openresolv
|
RUN apk add --no-cache bash curl iptables nftables openresolv
|
||||||
# Setup timezone
|
# Setup timezone
|
||||||
ENV TZ=Europe/Vienna
|
ENV TZ=UTC
|
||||||
# Copy binaries
|
# Copy binaries
|
||||||
COPY --from=builder /build/dist/wg-portal /app/wg-portal
|
COPY --from=builder /build/dist/wg-portal /app/wg-portal
|
||||||
# Set the Current Working Directory inside the container
|
# Set the Current Working Directory inside the container
|
||||||
|
Loading…
Reference in New Issue
Block a user