Skip to content

Commit

Permalink
Merge pull request #135 from lymnyx/add-docker
Browse files Browse the repository at this point in the history
Adding Docker support
  • Loading branch information
gtim authored Nov 20, 2024
2 parents d22171a + 75e29e3 commit 162d60d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Build notes

## Node (normal build)

1. `cp .env.example .env` -- adjust this config to your environment.
2. `npm install`
3. `npx prisma db push`
4. `npm run build`
5. `node server.js`

For dev build, replace steps 4-5 with `npm run dev -- --host`.

## Docker Compose

1. `cp .env.example .env` -- adjust this config to your environment.
2. `docker compose up --build -d`

Whenever you change environment variables in `.env`, rebuild the container to have the changes take effect.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM "node:alpine"

WORKDIR /code

COPY package.json .

RUN npm install

COPY . .

RUN npx prisma db push && npm run build

EXPOSE 3123

CMD ["node", "server.js"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
app:
build: .
container_name: chessdriller
ports:
- "3123:3123"
volumes:
- ./prisma:/code/prisma
restart: unless-stopped
environment:
- NODE_ENV=production

0 comments on commit 162d60d

Please sign in to comment.