Skip to content

Commit

Permalink
Merge pull request #4 from OSMCha/feature/dockerfile
Browse files Browse the repository at this point in the history
Update dockerfile
  • Loading branch information
willemarcel authored Apr 9, 2024
2 parents fb83a13 + dd945b3 commit 9694531
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker-publish.yml
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
13 changes: 4 additions & 9 deletions Dockerfile
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

0 comments on commit 9694531

Please sign in to comment.