forked from pycontw/pycon.tw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.Dockerfile
44 lines (35 loc) · 1.18 KB
/
dev.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
FROM python:3.6-slim-buster
ENV PYTHONUNBUFFERED 1
WORKDIR /app
ENV BASE_DIR /usr/local
ENV NVM_INSTALLER_URL https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh
ENV NVM_DIR $BASE_DIR/nvm
ENV YARN_VERSION 1.15.2-1
ENV NODE_VERSION 8.16.0
# make nodejs and yarn accessible and executable globally
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# Infrastructure tools
# gettext is used for django to compile .po to .mo files.
RUN apt-get update
RUN apt-get install apt-utils -y
RUN apt-get update
RUN apt-get install gettext python3-pip -y
# Install Node and Yarn from upstream
RUN curl -o- $NVM_INSTALLER_URL | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& nvm --version \
&& npm install -g yarn \
&& yarn --version
# Install Python dependencies
COPY ./requirements ./requirements
RUN pip3 install -r ./requirements/dev.txt
# # Install Javascript dependencies
COPY ./package.json ./package.json
COPY ./yarn.lock ./yarn.lock
RUN yarn install --dev --frozen-lockfile
# for entry point
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh