Skip to content

Commit ebc3953

Browse files
authored
Merge pull request #5 from hotosm/feat/set-up-frontend
Created frontend folder for npm + tailwind config
2 parents 472795a + a8c9278 commit ebc3953

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
**/.pytest_cache/
66
**/.venv/
77
node_modules
8-
/dist/
8+
**/dist/

Dockerfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ ARG NODE_IMG_TAG=20.5.1
33

44
FROM node:${NODE_IMG_TAG}-bookworm-slim as frontend-base
55
WORKDIR /app
6-
COPY package*.json ./
7-
RUN npm install
8-
COPY . .
9-
RUN npm run build
6+
COPY ./frontend ./frontend
7+
RUN cd frontend && npm install
8+
RUN cd frontend && npm run build
109

1110
# Define the base stage
1211
FROM docker.io/python:${PYTHON_IMG_TAG}-slim-bookworm as base
@@ -101,8 +100,8 @@ COPY --from=build \
101100
/home/wagtail/.local
102101
# Copy compiled css from frontend stage
103102
COPY --from=frontend-base \
104-
/app/dist \
105-
/app/dist
103+
/app/frontend/dist \
104+
/app/frontend/dist
106105
# Use /app folder as a directory where the source code is stored.
107106
WORKDIR /app
108107
# Copy project
File renamed without changes.

package.json renamed to frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"scripts": {
1313
"test": "echo \"Error: no test specified\" && exit 1",
14-
"build": "for file in ./*/static/css/*.css; do postcss $file -o ./dist/css/$(basename $file .css)_processed.css; done",
15-
"start": "postcss ./*/static/css/*.css -d ./dist/css/ --watch"
14+
"build": "for file in ../*/static/css/*.css; do postcss $file -o ./dist/css/$(basename $file .css)_processed.css; done",
15+
"start": "for file in ../*/static/css/*.css; do postcss $file -o ./dist/css/$(basename $file .css)_processed.css --watch; done"
1616
},
1717
"repository": {
1818
"type": "git",
File renamed without changes.

hot_osm/settings/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
]
143143

144144
STATICFILES_DIRS = [
145-
"dist",
145+
os.path.join(BASE_DIR, "frontend", "dist"),
146146
]
147147

148148
# Djang Compressor settings

0 commit comments

Comments
 (0)