Skip to content

Commit

Permalink
modify Dockerfile to include UI build step, include package-locks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarcosfer committed Jun 15, 2022
1 parent 961a44f commit 7d39418
Show file tree
Hide file tree
Showing 6 changed files with 4,815 additions and 16 deletions.
3 changes: 3 additions & 0 deletions examples/demos/discogs-autotagging/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*/node_modules
*/public
*/README.md
7 changes: 7 additions & 0 deletions examples/demos/discogs-autotagging/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
!package-lock.json
.vscode
33 changes: 19 additions & 14 deletions examples/demos/discogs-autotagging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
FROM node:14.18.1
FROM node:14.18.1 as fe-builder

WORKDIR /usr/src/app
COPY views/package.json .
RUN npm install

# COPY . .
COPY views/ .
RUN npm run build

RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y ffmpeg
FROM node:14.18.1

COPY ./server ./server
WORKDIR /usr/src/app/server
RUN npm ci --only=production
ENV PORT=8000
RUN apt-get -y update && \
apt-get install -y ffmpeg && \
rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app

COPY ./views/dist/ ./public
# WORKDIR /usr/src/app/views
# RUN npm ci --only=production
# RUN npm run build
COPY server/package.json .

RUN npm install

COPY ./server/ ./
COPY --from=fe-builder /usr/src/app/dist/ ./public

EXPOSE 8000
ENV PORT=8000

# WORKDIR /usr/src/app/server
WORKDIR /usr/src/app
CMD node server.js
2 changes: 0 additions & 2 deletions examples/demos/discogs-autotagging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ Demo showing realtime music autotagging based on the Discogs taxonomy (400 subge
- `npm run dev`

## To build for deployment:
- `cd views`
- `npm run build`
- `docker build -t discogs-demo:latest .`
- `docker run --rm -it -p 8000:8000 discogs-demo:latest node server.js`
Loading

0 comments on commit 7d39418

Please sign in to comment.