Kaynağa Gözat

update nodejs for tailwind

Prach Pongpanich 2 yıl önce
ebeveyn
işleme
02371e2aca
5 değiştirilmiş dosya ile 13 ekleme ve 6 silme
  1. 2 0
      .gitignore
  2. 2 3
      Dockerfile
  3. 2 2
      app/package.json
  4. 3 0
      app/static/css/input.css
  5. 4 1
      docker-compose.yml

+ 2 - 0
.gitignore

157
 CACHE/
157
 CACHE/
158
 media.zip
158
 media.zip
159
 data.zip
159
 data.zip
160
+
161
+app/static/css/main.css

+ 2 - 3
Dockerfile

6
 RUN apt-get install -y libjpeg62 libjpeg62-turbo-dev  zlib1g-dev gettext entr
6
 RUN apt-get install -y libjpeg62 libjpeg62-turbo-dev  zlib1g-dev gettext entr
7
 RUN \
7
 RUN \
8
         echo "Installing Node and Yarn" && \
8
         echo "Installing Node and Yarn" && \
9
-        echo "deb https://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/nodesource.list && \
10
-        wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
9
+	curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
11
         echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
10
         echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
12
         wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
11
         wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
13
         apt-get update && \
12
         apt-get update && \
14
-        apt-get install -yqq nodejs yarn npm && \
13
+        apt-get install -yqq nodejs yarn  && \
15
         npm install -g nodemon && \ 
14
         npm install -g nodemon && \ 
16
         rm -rf /var/lib/apt/lists/* 
15
         rm -rf /var/lib/apt/lists/* 
17
 WORKDIR /code
16
 WORKDIR /code

+ 2 - 2
app/package.json

1
 {
1
 {
2
   "scripts": {
2
   "scripts": {
3
-    "build": "tailwindcss -i ./css/input.css -o ./css/main.css ",
4
-    "watch": "tailwindcss -i ./css/input.css -o ./css/main.css --watch"
3
+    "build": "tailwindcss -i ./static/css/input.css -o ./static/css/main.css ",
4
+    "watch": "tailwindcss -i ./static/css/input.css -o ./static/css/main.css --watch"
5
   },
5
   },
6
   "devDependencies": {
6
   "devDependencies": {
7
     "tailwindcss": "^3.3.2"
7
     "tailwindcss": "^3.3.2"

+ 3 - 0
app/static/css/input.css

1
+@tailwind base;
2
+@tailwind components;
3
+@tailwind utilities;

+ 4 - 1
docker-compose.yml

18
       - POSTGRES_PASSWORD=postgres
18
       - POSTGRES_PASSWORD=postgres
19
   web:
19
   web:
20
     build: .
20
     build: .
21
-    command: python -X dev manage.py  runserver 0.0.0.0:8000
21
+    command: >
22
+     sh -c "npm run watch &&
23
+            python manage.py migrate &&
24
+            python manage.py runserver 0.0.0.0:8000"
22
     #entrypoint: ./server-entrypoint.sh
25
     #entrypoint: ./server-entrypoint.sh
23
     volumes:
26
     volumes:
24
       - ./app:/code
27
       - ./app:/code