mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-02-23 07:04:19 +01:00
Dockerfile
This commit is contained in:
committed by
benthecarman
parent
c0d540518f
commit
2cec589e96
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
.gitignore
|
||||
.github
|
||||
*.md
|
||||
dist
|
||||
justfile
|
||||
44
Dockerfile
Normal file
44
Dockerfile
Normal file
@@ -0,0 +1,44 @@
|
||||
# Use Node.js as a base image for building the site
|
||||
FROM node:19-slim AS builder
|
||||
|
||||
RUN apt update && apt install -y git
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm globally
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Add the ARG directives for build-time environment variables
|
||||
ARG VITE_NETWORK="bitcoin"
|
||||
ARG VITE_PROXY="wss://p.mutinywallet.com"
|
||||
ARG VITE_ESPLORA="https://mutinynet.com/api"
|
||||
ARG VITE_LSP="https://lsp.voltageapi.com"
|
||||
ARG VITE_RGS="https://rgs.mutinynet.com/snapshot/"
|
||||
ARG VITE_AUTH="https://auth.mutinywallet.com"
|
||||
ARG VITE_STORAGE="https://storage.mutinywallet.com"
|
||||
ARG VITE_SELFHOSTED="true"
|
||||
|
||||
# Copy package.json and pnpm-lock.yaml (or shrinkwrap.yaml) to utilize Docker cache
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install
|
||||
|
||||
# Copy the rest of the files
|
||||
COPY . .
|
||||
|
||||
# Build the static site
|
||||
RUN pnpm run build
|
||||
|
||||
# Now, use Nginx as a base image for serving the site
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the static assets from the builder stage to the Nginx default static serve directory
|
||||
COPY --from=builder /app/dist/public /usr/share/nginx/html
|
||||
|
||||
# Expose the default Nginx port
|
||||
EXPOSE 80
|
||||
|
||||
# Start Nginx when the container starts
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user