forked from Wikia/mobile-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
50 lines (37 loc) · 1.27 KB
/
Dockerfile.dev
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
FROM node:8.9.1-alpine
WORKDIR /app
# passes IMAGE_VERSION build-arg to environment variable to use it in application
ARG IMAGE_VERSION
ENV IMAGE_VERSION ${IMAGE_VERSION}
# move files to cache installing of dependencies
COPY .npmrc .
COPY package-lock.json .
COPY package.json .
# create group and user
RUN addgroup -S mobile-wiki && \
adduser -h /app -s /sbin/nologin -D -G mobile-wiki -u 1337 docker_user && \
chmod 755 /app && \
# install missing stuff
apk add --no-cache --virtual .gyp python make g++ git && \
# install npm globals
npm set progress=false && \
npm install -g ember-cli && \
# install all dependencies
npm run setup && \
# cleanup
apk del .gyp python make g++ git && \
npm cache clean --force
USER docker_user
# copy app
# Note:
# - first argument is the path inside the context of build (folder where Dockerfile is placed)
# - second argument is the docker daemon (newly created container)
# - "." means "current working directory", and since we're not selecting any specific files
# it's basically "copy everything from mobile-wiki project to WORKDIR in docker"
COPY . .
# build app
RUN npm run build
# 7001 is for debugging
EXPOSE 7001
# run fastboot-server when 'docker run' will be called
ENTRYPOINT ["npm", "run", "fastboot-server"]