-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
44 lines (35 loc) · 869 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
37
38
39
40
41
42
FROM node:lts-alpine AS base
WORKDIR /app
COPY package.json .
# Install deps
# FROM base AS prod-deps
# RUN npm install --omit=dev
FROM base AS build-deps
RUN npm install
# Build
FROM build-deps AS build
COPY . .
ENV NODE_OPTIONS=--max_old_space_size=4096
RUN npm run build
# RUN nginx
FROM nginx:alpine AS runtime
COPY ./nginx /etc/nginx
COPY --from=build /app/dist /usr/share/nginx/html
ENV PORT=8080
EXPOSE 8080
# -------
## RUN node
# FROM base AS runtime
# COPY --from=build /app/dist ./dist
# RUN addgroup --system --gid 12232 lukefileserva &&\
# adduser --system --uid 12232 lukefileserva &&\
# chown -R lukefileserva:lukefileserva /app
# USER lukefileserva:lukefileserva
# RUN id
# CMD node ./dist/server/entry.mjs
# -------
## RUN apache
# FROM httpd:2.4 AS runtime
# WORKDIR .
# COPY --from=build /app/dist /usr/local/apache2/htdocs/
# EXPOSE 80