Skip to content

Commit

Permalink
build: improve docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
neferin12 committed Apr 16, 2024
1 parent 486040c commit e42399a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
FROM node:lts
ENV NODE_ENV=production
WORKDIR /app

RUN npm install -g typescript && corepack enable
FROM node:lts as base
RUN corepack enable

FROM base as builder
WORKDIR /app
COPY ["package.json", "pnpm-lock.yaml", "./"]

RUN pnpm install

COPY . .

RUN pnpm run build

CMD ["pnpm", "run", "start"]
FROM base as runtime
ENV NODE_ENV=production

WORKDIR /app
COPY ["package.json", "pnpm-lock.yaml", "./"]
RUN pnpm install --prod

COPY --from=builder /app/dist /app/dist

CMD ["node", "."]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Alternatively the following [`docker-compose.yaml`](./docker-compose.yaml) can b
version: "3"
services:
matrix-studrss-bot:
image: matrixstudrssbot:latest
image: ghcr.io/neferin12/matrix-studrss-bot:latest
container_name: matrixstudrssbot
env_file:
- .env
Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
version: "3.5"
services:
matrix-studrss-bot:
image: matrixstudrssbot:latest
build: .
image: ghcr.io/neferin12/matrix-studrss-bot:latest
container_name: matrixstudrssbot
env_file:
- .env
environment:
- ACCESS_TOKEN=TODO
- HOMESERVER_URL=TODO
- POSTGRES_HOST=postgres
restart: unless-stopped
postgres:
image: postgres:16-alpine
Expand Down

0 comments on commit e42399a

Please sign in to comment.