-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
77 lines (51 loc) · 1.24 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM node:lts-alpine as builder
WORKDIR /src
COPY package.json yarn.lock ./
RUN apk add --no-cache git automake autoconf libtool zlib zlib-dev g++ make libpng-dev
RUN yarn install \
--prefer-offline \
--frozen-lockfile \
--non-interactive \
--production=false
ARG ELASTIC_SEARCH_SERVER
ARG ELASTIC_SEARCH_CREDENTIALS
ARG CONTACT_MESSAGE_RELAY_URL
ARG RECAPTCHA_KEY
ARG MEDIA_URL
ARG API_URL
ENV NODE_ENV=production
ENV NUXT_TELEMETRY_DISABLED=1
COPY . .
RUN yarn build
RUN rm -rf node_modules && \
NODE_ENV=production yarn install \
--prefer-offline \
--pure-lockfile \
--non-interactive \
--production=true
FROM node:lts-alpine as production
WORKDIR /src
COPY --from=builder /src .
ENV HOST 0.0.0.0
EXPOSE 3000
USER 33
CMD [ "yarn", "start" ]
FROM node:lts-alpine as development
WORKDIR /home/node
RUN apk add --no-cache git automake autoconf libtool zlib zlib-dev g++ make libpng-dev
USER 1000
COPY package.json yarn.lock ./
ARG ELASTIC_SEARCH_SERVER
ARG ELASTIC_SEARCH_CREDENTIALS
ARG CONTACT_MESSAGE_RELAY_URL
ARG RECAPTCHA_KEY
ARG MEDIA_URL
ARG API_URL
RUN NODE_ENV=development yarn install \
--prefer-offline \
--pure-lockfile \
--non-interactive \
--production=false
COPY . .
EXPOSE 3000
CMD [ "yarn", "dev" ]