-
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.
Merge pull request #4 from OSMCha/feature/dockerfile
Update dockerfile
- Loading branch information
Showing
2 changed files
with
39 additions
and
9 deletions.
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,35 @@ | ||
name: Build Docker Image, Push to GHCR | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/osmcha/osm-adiff-service:latest | ||
ghcr.io/osmcha/osm-adiff-service:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
FROM node:14.18-alpine | ||
ENV APP_DIR=/usr/local/src/app | ||
FROM node:18-alpine | ||
|
||
WORKDIR ${APP_DIR} | ||
ARG NPMAccessToken | ||
RUN echo "//registry.npmjs.org/:_authToken=$NPMAccessToken" > ./.npmrc | ||
COPY package*.json ./ | ||
RUN npm ci --ignore-engines && cd "$APP_DIR/node_modules/@mapbox/watchbot" && npm link && cd $APP_DIR | ||
COPY . . | ||
RUN chmod 0555 index.js | ||
COPY . /app | ||
WORKDIR /app | ||
RUN yarn install |