mirror of
https://github.com/janishutz/MusicPlayer.git
synced 2026-09-10 14:25:24 +02:00
chore: basic dockerfiles
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
FROM node:25-alpine3.21 AS build
|
||||||
|
|
||||||
|
WORKDIR /usr/src/build
|
||||||
|
COPY . /usr/src/build
|
||||||
|
|
||||||
|
RUN npm i
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
|
# Prod build with fewer deps
|
||||||
|
FROM node:25-alpine3.21 AS prod
|
||||||
|
|
||||||
|
WORKDIR /usr/src/musicplayer
|
||||||
|
COPY --from=build /usr/src/build/dist /usr/src/musicplayer/dist
|
||||||
|
COPY ./index.js /usr/src/musicplayer/index.js
|
||||||
|
|
||||||
|
RUN npm i --omit=dev
|
||||||
|
|
||||||
|
CMD [ "node", "index.js" ]
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
FROM node:25-alpine3.21 AS build
|
||||||
|
|
||||||
|
# Frontend Build stage
|
||||||
|
WORKDIR /usr/src/build
|
||||||
|
|
||||||
|
COPY . /usr/src/build
|
||||||
|
|
||||||
|
RUN npm i
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Build final image
|
||||||
|
FROM nginx AS prod
|
||||||
|
COPY --from=build /usr/src/build/dist /usr/share/nginx/html
|
||||||
|
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
EXPOSE 3000
|
||||||
Reference in New Issue
Block a user