Skip to content

Commit ff821e3

Browse files
committed
Update dockerfile
1 parent f43a28f commit ff821e3

2 files changed

Lines changed: 16 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,18 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v4
2121

22-
- name: Setup Bun
23-
uses: oven-sh/setup-bun@v2
24-
with:
25-
bun-version: latest
26-
27-
- name: Install dependencies
28-
run: bun install --frozen-lockfile
29-
30-
- name: Build
31-
run: bun run build
32-
33-
- name: Sync build artifacts to deploy path
22+
- name: Sync source to deploy path
3423
run: |
3524
mkdir -p "$DEPLOY_PATH"
36-
rsync -a --delete dist/ "$DEPLOY_PATH/"
37-
cp Dockerfile "$DEPLOY_PATH/Dockerfile"
25+
rsync -a --delete \
26+
--exclude=node_modules \
27+
--exclude=.git \
28+
--exclude=dist \
29+
./ "$DEPLOY_PATH/"
3830
3931
- name: Build Docker image
4032
working-directory: ${{ env.DEPLOY_PATH }}
41-
run: docker build -t "$IMAGE_NAME:latest" .
33+
run: docker build --pull -t "$IMAGE_NAME:latest" .
4234

4335
- name: Restart container
4436
run: |

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
FROM nginx:alpine
1+
FROM oven/bun:1 AS build
2+
WORKDIR /app
3+
COPY package.json bun.lock ./
4+
RUN bun install --frozen-lockfile
5+
COPY . .
6+
RUN bun run build
27

8+
FROM nginx:alpine
39
RUN apk --no-cache upgrade \
4-
&& rm -rf /usr/share/nginx/html/*
10+
&& rm -rf /usr/share/nginx/html/*
511

6-
COPY . /usr/share/nginx/html/
12+
COPY --from=build /app/dist /usr/share/nginx/html/
713

814
EXPOSE 80

0 commit comments

Comments
 (0)