-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
35 lines (28 loc) · 1.01 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
FROM python:3.9.7-slim-bullseye as base
# Install node
ENV NODE_VERSION=16.16.0
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN apt update \
&& apt install -y curl git libgbm-dev \
&& curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
&& apt clean
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} \
&& . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} \
&& . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
# Install yarn
RUN npm i -g yarn
# Setup Python and Black for the formatters
RUN python -m ensurepip && pip install --upgrade pip && pip install --no-cache setuptools wheel black==21.7b0 guesslang==2.2.1
RUN mkdir /app
COPY package.json jest.config.js yarn.lock tsconfig.json app/
COPY src/ /app/src
COPY tests/ /app/tests
WORKDIR /app
RUN rm -rf node_modules && yarn install --frozen-lockfile
FROM base as test
CMD yarn jest
FROM base as build
RUN yarn build
EXPOSE 3000
CMD ["node", "./build/main/src/index.js"]