Skip to content

Commit

Permalink
Merge pull request #170 from hellos3b/f/build
Browse files Browse the repository at this point in the history
build: js files built before docker
  • Loading branch information
hellos3b authored Aug 15, 2022
2 parents a4bfdf9 + 3ee7a46 commit 9f5c017
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13,874 deletions.
16 changes: 9 additions & 7 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ FROM node:16 as builder
WORKDIR /app

RUN npm install --global pnpm@6
COPY pnpm-lock.yaml .
RUN pnpm fetch
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --production

# Copy files required to build
ADD package*.json bsconfig.json tsconfig.json ./
ADD src/ ./src/

RUN pnpm install -r --offline
RUN pnpm build:re
RUN pnpm build:ts
# ADD package*.json bsconfig.json tsconfig.json ./
# ADD src/ ./src/

COPY build/ ./build/

# RUN pnpm build:re
# RUN pnpm build:ts

ENTRYPOINT pnpm start:prod
9 changes: 8 additions & 1 deletion bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ pnpm start

## Deploy Bot

First, create a [Docker Context](https://docs.docker.com/engine/context/working-with-contexts/) using your ssh host as a target. Then, pretending I named my context "s3bby":
The docker image copies over the built js files, so first build the entire project:

```sh
pnpm build:re
pnpm build:ts
```

Next, create a [Docker Context](https://docs.docker.com/engine/context/working-with-contexts/) using your ssh host as a target. Then, pretending I named my context "s3bby":

```sh
$env:DOCKER_CONTEXT="s3bby"
Expand Down
Loading

0 comments on commit 9f5c017

Please sign in to comment.