-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuild app. Removed snapcraft.yaml. Upgraded Alpine. Updated GitHub …
…Actions
- Loading branch information
1 parent
447e152
commit aeeadec
Showing
29 changed files
with
1,256 additions
and
3,933 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 |
---|---|---|
|
@@ -10,6 +10,4 @@ node_modules/ | |
npm-debug.log | ||
|
||
# App | ||
config.json | ||
*.log | ||
app/config/reports/*.json | ||
app/reports/*.json |
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,31 @@ | ||
# When the workflow succeeds the package will be published to docker hub | ||
|
||
name: Publish Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: glenndehaan/devinfo:latest |
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 |
---|---|---|
|
@@ -10,6 +10,4 @@ node_modules/ | |
npm-debug.log | ||
|
||
# App | ||
config.json | ||
*.log | ||
app/config/reports/*.json | ||
app/reports/*.json |
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,22 +1,76 @@ | ||
FROM alpine:3.14 | ||
#===================================================== | ||
# Build Stage | ||
#===================================================== | ||
|
||
# | ||
# Define OS | ||
# | ||
FROM alpine:3.20 AS dependencies | ||
|
||
# | ||
# Basic OS management | ||
# | ||
|
||
# Install packages | ||
RUN apk add --no-cache nodejs npm | ||
|
||
# Create app directory | ||
WORKDIR /usr/app | ||
# | ||
# Require app | ||
# | ||
|
||
# Create config volume | ||
VOLUME ["/var/app"] | ||
# Create app directory | ||
WORKDIR /app | ||
|
||
# Bundle app source | ||
COPY . . | ||
# Bundle package.json and package-lock.json | ||
COPY ./package.json ./package-lock.json ./ | ||
|
||
# Install dependencies | ||
RUN npm ci --only=production | ||
RUN npm ci --only=production && npm cache clean --force | ||
|
||
#===================================================== | ||
# Image Stage | ||
#===================================================== | ||
|
||
# | ||
# Define OS | ||
# | ||
FROM alpine:3.20 | ||
|
||
# | ||
# Basic OS management | ||
# | ||
|
||
# Install packages | ||
RUN apk add --no-cache dumb-init nodejs | ||
|
||
# | ||
# Require app | ||
# | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
||
# | ||
# Setup app | ||
# | ||
|
||
# Expose app | ||
EXPOSE 4289 | ||
EXPOSE 3000 | ||
|
||
# Set node env | ||
ENV NODE_ENV=production | ||
|
||
# Setup healthcheck | ||
HEALTHCHECK --interval=10s --timeout=3s \ | ||
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/_health || exit 1 | ||
|
||
# Run app | ||
CMD ["node", "./app/bundle-docker.js"] | ||
CMD ["dumb-init", "node", "/app/server.js"] | ||
|
||
# | ||
# Bundle app | ||
# | ||
|
||
# Bundle from build image | ||
COPY --from=dependencies /app/node_modules ./node_modules | ||
COPY app . |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.