-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from lymnyx/add-docker
Adding Docker support
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |