Add Dockerfile
This commit is contained in:
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
||||
# Build stage
|
||||
FROM node:18-bullseye AS builder
|
||||
|
||||
# Add build arg to bust cache when needed
|
||||
ARG CACHEBUST=1
|
||||
|
||||
# Install dependencies for keytar and other native modules
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
build-essential \
|
||||
python3 \
|
||||
libsecret-1-dev \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /workspace
|
||||
|
||||
# Clone the repository (this will be affected by CACHEBUST)
|
||||
RUN echo "Cache bust: $CACHEBUST" && git clone https://github.com/standardnotes/app.git
|
||||
|
||||
# Change to app directory
|
||||
WORKDIR /workspace/app
|
||||
|
||||
# Install dependencies and build
|
||||
RUN yarn install && yarn build:web
|
||||
|
||||
# Production stage
|
||||
FROM python:3.11-alpine
|
||||
|
||||
# Copy built web application from builder stage
|
||||
COPY --from=builder /workspace/app/packages/web /app
|
||||
|
||||
# Set working directory to the web app
|
||||
WORKDIR /app/dist
|
||||
|
||||
# Expose port 8080
|
||||
EXPOSE 8080
|
||||
|
||||
# Start the Python HTTP server
|
||||
CMD ["python", "-m", "http.server", "8080"]
|
Reference in New Issue
Block a user