Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker container #105

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git

node_modules

public
19 changes: 16 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ on:
branches: [ main ]
jobs:
build:
env:
CI: true
MONGO_URL: mongodb://localhost/nutri-sight
strategy:
matrix:
node-version: [20.x]
mongodb-version: [ '7.0', '6.0' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js version 20
- name: Use Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm install
node-version: ${{ matrix.node-version }}
- name: Use MongoDB from Github Actions
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: npm install
# - run: npm run build
# - run: npm test
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:lts-alpine

WORKDIR /app

COPY package*.json ./
RUN npm install --omit=dev

COPY . .
RUN npm run build

USER node

CMD [ "npm", "start" ]

EXPOSE 3000
Loading