-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
104 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: build docker images | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: build | ||
run: | | ||
VERSION="latest" | ||
TAG="${{secrets.DOCKER_REGISTRY}}/${{secrets.DOCKER_SPACE}}" | ||
IMAGE="${{secrets.IMAGE_NAME}}" | ||
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWD }} ${{secrets.DOCKER_REGISTRY}} | ||
docker build --target runner -t "${TAG}/${IMAGE}:${VERSION}" . | ||
docker push "${TAG}/${IMAGE}:${VERSION}" |
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,17 @@ | ||
FROM node:22.1.0-alpine3.19 AS builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
RUN npm install | ||
RUN npm run build | ||
|
||
FROM node:22.1.0-alpine3.19 AS runner | ||
WORKDIR /usr/src/app | ||
COPY --from=builder /usr/src/app/.output ./.output | ||
COPY --from=builder /usr/src/app/package.json ./package.json | ||
COPY --from=builder /usr/src/app/package-lock.json ./package-lock.json | ||
RUN npm install --only=production | ||
EXPOSE 3000 | ||
|
||
CMD [ "node", "./.output/server/index.mjs" ] |
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
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,21 @@ | ||
# shell编程 | ||
|
||
以`bash`为例 | ||
|
||
## shell开始 | ||
|
||
shell脚本执行有多种方式 | ||
+ ./cmd.sh | ||
执行cmd.sh | ||
+ source cmd.sh 或 . ./source.sh | ||
+ bash cmd.sh | ||
|
||
```shell | ||
#!/usr/bin/env bash | ||
echo "Hello world!" | ||
``` | ||
/usr/bin/env bash 用于直接执行shell脚本时`./cmd.sh`, 指定shell的解释器, /usr/bin/env bash是在环境变量中查找bash, 如果写成`/bin/bash`, 则bash只能在/bin目录下. | ||
|
||
|
||
|
||
|