-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
36 lines (27 loc) · 945 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ---- Build ----
FROM node:20-alpine as builder
LABEL org.opencontainers.image.title="ampcast" \
org.opencontainers.image.description="A music player inspired by Winamp" \
org.opencontainers.image.url="https://ampcast.app" \
org.opencontainers.image.source="https://github.com/rekkyrosso/ampcast" \
org.opencontainers.image.version="0.9.12" \
org.opencontainers.image.licenses="GPLv3"
WORKDIR /app
COPY . /app
# install deps
RUN npm i
# build the web view
RUN npm run build:docker
# ---- Release ----
FROM node:20-alpine as release
WORKDIR /app
# copy build
COPY --from=builder --chown=node:node /app/app/www ./app/www
COPY --from=builder --chown=node:node /app/server.js ./server.js
COPY --from=builder --chown=node:node /app/package.json ./package.json
COPY --from=builder --chown=node:node /app/node_modules ./node_modules
# don't run as root
USER node
EXPOSE 8000
# start app
CMD ["npm", "run", "start:docker"]