forked from 200ok-ch/organice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (23 loc) · 936 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
FROM node:12.13-alpine3.9
# Switch to Apline Linux Mirror of Clarkson University:
# https://mirror.clarkson.edu/distributions.html#alpine
# This fixes an issue with hanging fetch commands in CI, see also
# https://github.com/gliderlabs/docker-alpine/issues/307#issuecomment-427465925
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/http\:\/\/mirror.clarkson.edu/g' /etc/apk/repositories
RUN apk add --no-cache bash yarn
WORKDIR /opt/organice
COPY package.json yarn.lock /opt/organice/
RUN yarn install
COPY . /opt/organice
RUN yarn global add serve \
&& yarn build \
&& yarn cache clean \
&& rm -rf node_modules
# No root privileges are required. Create and switch to non-root user.
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
RUN addgroup -S organice \
&& adduser -S organice -G organice
USER organice
ENV NODE_ENV=production
EXPOSE 5000
ENTRYPOINT ["serve", "-s", "build"]