-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile
48 lines (38 loc) · 1.33 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
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:14
# Install Python
RUN apt-get update && apt-get install -y python3 python3-pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*2
WORKDIR /code
# Node and webpack
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends vim curl gnupg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y --no-install-recommends nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY ./requirements/base.txt /code/base.txt
COPY ./requirements/development.txt /code/development.txt
COPY ./requirements/testing.txt /code/testing.txt
RUN pip3 install -r /code/development.txt --no-cache-dir
RUN pip3 install -r /code/testing.txt --no-cache-dir
ADD package.json package-lock.json ./
RUN npm install
# ENV should be configure from outside
# @see docker-compose.yaml
ENV DB_NAME cuuhomientrung
ENV DB_USER cuuhomientrung
ENV DB_PASSWORD cuuhomientrung
ENV DB_HOSTNAME localhost
ENV DB_PORT 5432
ENV PYTHONUNBUFFERED=1
ADD . /code/
RUN npm run build
RUN chmod +x *.sh
# Helpers making development easier
RUN echo "#!/bin/bash\ncd /code\npython project/manage.py runserver_plus 0.0.0.0:8087" > /usr/bin/rs && \
chmod +x /usr/bin/rs
CMD ["bash", "-c", "tail -f /dev/null"]
EXPOSE 8087/tcp