Docker works now
This commit is contained in:
parent
c010ea4ea7
commit
8ea7faf483
@ -1,33 +1,29 @@
|
|||||||
# Stage 1: Build the project
|
# Stage 1: Build the project
|
||||||
FROM node:18 as builder
|
FROM node:18 AS builder
|
||||||
|
|
||||||
# Set the working directory in the container
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package.json and pnpm-lock.yaml or package-lock.json (if using npm) to the working directory
|
# Copy package.json and pnpm-lock.yaml to the working directory
|
||||||
COPY ../package.json ../pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|
||||||
# Copy project files into the docker image
|
# Copy project files into the docker image
|
||||||
COPY ../ .
|
COPY . .
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# Stage 2: Serve the app using a lightweight node image
|
# Stage 2: Serve the app using the same version of Node
|
||||||
FROM node:16-alpine
|
FROM node:18-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
# Install a simple http server
|
# Install a simple http server
|
||||||
RUN npm install -g serve
|
RUN npm install -g serve
|
||||||
|
|
||||||
# Set the working directory to /app
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy built assets from the builder stage
|
# Copy built assets from the builder stage
|
||||||
COPY --from=builder /app/dist /app
|
COPY --from=builder /app/dist ./
|
||||||
|
|
||||||
# Expose port 5000 for the server
|
# Expose port 5000 for the server
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
@ -16,7 +16,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/app # mount the parent directory to /app in the container
|
- ../:/app # mount the parent directory to /app in the container
|
||||||
command: serve -s /app -l 5000
|
command: serve -s /app/dist -l 5000
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
node_apps:
|
node_apps:
|
||||||
|
@ -24,13 +24,8 @@
|
|||||||
media="print"
|
media="print"
|
||||||
onload="this.media='all'"
|
onload="this.media='all'"
|
||||||
/>
|
/>
|
||||||
<script
|
|
||||||
defer
|
|
||||||
data-domain="unduck.link"
|
|
||||||
src="https://plausible.io/js/script.js"
|
|
||||||
></script>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Unduck</title>
|
<title>Bang</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content="A better default search engine (with bangs!)"
|
content="A better default search engine (with bangs!)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user