-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile-test-acceptance
50 lines (39 loc) · 1.44 KB
/
Dockerfile-test-acceptance
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
# https://hub.docker.com/_/node/
FROM node:14.16.1-alpine
ARG VCS_REF=not_ci
LABEL org.label-schema.description="PagerDuty on-call dashboard widget" \
org.label-schema.name="PagerBeauty" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://work.sergii.org/pagerbeauty" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/sergiitk/pagerbeauty" \
org.label-schema.vendor="Sergii Tkachenko <hi@sergii.org>"
# Environment
ENV APP_DIR=/usr/src/app
# Create app directory
WORKDIR $APP_DIR
# Install
COPY package.json yarn.lock $APP_DIR/
RUN yarn install --prod --frozen-lockfile \
&& yarn cache clean
# Pagerbeauty default port
EXPOSE 8080
# ---------- Dev image from here
# NPM config and dev environment
RUN npm config set scripts-prepend-node-path true \
&& mkdir -v $APP_DIR/tmp
# Install the rest
RUN yarn install --frozen-lockfile
# ---------- Acceptance test image from here
# Installs latest Chromium 81.0.4044.113-r0 available in Apline 3.11:
# Alpine: https://github.com/nodejs/docker-node/blob/8b8ee/12/alpine3.11/Dockerfile
# Chromium: https://pkgs.alpinelinux.org/package/v3.11/community/x86_64/chromium
RUN apk update && apk upgrade && \
apk add --no-cache \
chromium
# TODO: create a user and omit no-sandbox
# Set default chrome path
ENV CHROME_PATH=/usr/bin/chromium-browser
# Bundle app source
COPY . .
ENTRYPOINT ["yarn", "run", "test:acceptance"]