Skip to content

Commit

Permalink
feat: add docker-compose support
Browse files Browse the repository at this point in the history
close #28
  • Loading branch information
gengjiawen committed Oct 23, 2023
1 parent 8715360 commit 5b1067d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
FROM node:lts

# Set the working directory in the container
WORKDIR /app

# Copy the package.json and pnpm-lock.yaml files to the container
COPY package.json ./
COPY pnpm-lock.yaml ./

# Install dependencies using Pnpm
RUN npm install -g pnpm && pnpm install --no-prefer-frozen-lockfile

# Copy the rest of the application code to the container
COPY . .

ENV NODE_ENV=production
RUN pnpm build

# Specify the command to run the application when the container starts
CMD ["node", "build/index.js"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'
services:
backend:
build:
context: ./
dockerfile: Dockerfile
restart: unless-stopped
ports:
- '3000:3000'
environment:
- ENV=production

0 comments on commit 5b1067d

Please sign in to comment.