Skip to content

Commit

Permalink
删掉site/dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbbbbbbbbbbba committed Sep 15, 2024
1 parent 2146621 commit 6fb7233
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 32 deletions.
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ FROM golang:1.23 AS server_builder
ENV APP_HOME=/code/bbs-go/server
WORKDIR "$APP_HOME"

# COPY ./server/go.mod ./
# COPY ./server/go.sum ./
COPY ./server ./
RUN go env -w GOPROXY=https://goproxy.cn,direct \
&& go mod download
RUN go mod download

# COPY ./server ./
RUN CGO_ENABLED=0 go build -v -o bbs-go main.go && chmod +x bbs-go


Expand All @@ -23,20 +20,20 @@ ENV APP_HOME=/code/bbs-go/site
WORKDIR "$APP_HOME"

COPY ./site ./
RUN npm install -g pnpm --registry=https://registry.npmmirror.com
RUN pnpm install --registry=https://registry.npmmirror.com
# RUN npm install -g pnpm --registry=https://registry.npmmirror.com
# RUN pnpm install --registry=https://registry.npmmirror.com
RUN npm install -g pnpm
RUN pnpm install
RUN pnpm build:docker


# run
FROM node:20-alpine

ENV APP_HOME=/app/bbs-go
WORKDIR "$APP_HOME"

COPY --from=site_builder /code/bbs-go/site/.output ./site/.output
COPY --from=site_builder /code/bbs-go/site/node_modules ./site/node_modules
COPY --from=server_builder /code/bbs-go/server/bbs-go ./server/bbs-go
COPY --from=server_builder /code/bbs-go/server/*.yaml ./server/
COPY --from=server_builder /code/bbs-go/server/*.yml ./server/
Expand Down
4 changes: 0 additions & 4 deletions site/.dockerignore

This file was deleted.

22 changes: 0 additions & 22 deletions site/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cd ${APP_HOME}/server
${APP_HOME}/server/bbs-go &

# 启动 bbs-go-site
cd ${APP_HOME}/site
node ${APP_HOME}/site/.output/server/index.mjs &

# 保持容器运行
Expand Down

0 comments on commit 6fb7233

Please sign in to comment.