Skip to content

Commit c2ce120

Browse files
committed
#74 ベースイメージの変更
1 parent 88f06dd commit c2ce120

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

.github/workflows/backend.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Backend Container Build and Push
2+
3+
on:
4+
push:
5+
branches:
6+
- 74-base-image
7+
paths:
8+
- 'example/backend/app/**'
9+
10+
jobs:
11+
deploy:
12+
runs-on: arc-runner-set
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Login to ECR
18+
uses: docker/login-action@v3
19+
with:
20+
registry: ACCOUNTID.dkr.ecr.ap-northeast-2.amazonaws.com
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
with:
25+
driver: kubernetes
26+
driver-opts: |
27+
namespace=arc-runners
28+
29+
- name: Set image tag (date)
30+
run: echo "IMAGE_TAG=$(TZ='Asia/Tokyo' date +'%Y%m%d%H%M')" >> $GITHUB_ENV
31+
32+
- name: Build and push
33+
uses: docker/build-push-action@v6
34+
env:
35+
DOCKER_BUILD_SUMMARY: false
36+
with:
37+
context: ./example/backend/app
38+
push: true
39+
provenance: false
40+
tags: ACCOUNTID.dkr.ecr.ap-northeast-2.amazonaws.com/backend:${{ env.IMAGE_TAG }}

example/backend/app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18
1+
FROM node:18.20.8-slim
22
WORKDIR /app
33
COPY package*.json ./
44
RUN npm install --production

0 commit comments

Comments
 (0)