Skip to content

Commit

Permalink
Merge pull request #5 from hotosm/feat/set-up-frontend
Browse files Browse the repository at this point in the history
Created frontend folder for npm + tailwind config
  • Loading branch information
katporks authored Dec 6, 2023
2 parents 472795a + a8c9278 commit ebc3953
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
**/.pytest_cache/
**/.venv/
node_modules
/dist/
**/dist/
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ ARG NODE_IMG_TAG=20.5.1

FROM node:${NODE_IMG_TAG}-bookworm-slim as frontend-base
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
COPY ./frontend ./frontend
RUN cd frontend && npm install
RUN cd frontend && npm run build

# Define the base stage
FROM docker.io/python:${PYTHON_IMG_TAG}-slim-bookworm as base
Expand Down Expand Up @@ -101,8 +100,8 @@ COPY --from=build \
/home/wagtail/.local
# Copy compiled css from frontend stage
COPY --from=frontend-base \
/app/dist \
/app/dist
/app/frontend/dist \
/app/frontend/dist
# Use /app folder as a directory where the source code is stored.
WORKDIR /app
# Copy project
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json → frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "for file in ./*/static/css/*.css; do postcss $file -o ./dist/css/$(basename $file .css)_processed.css; done",
"start": "postcss ./*/static/css/*.css -d ./dist/css/ --watch"
"build": "for file in ../*/static/css/*.css; do postcss $file -o ./dist/css/$(basename $file .css)_processed.css; done",
"start": "for file in ../*/static/css/*.css; do postcss $file -o ./dist/css/$(basename $file .css)_processed.css --watch; done"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion hot_osm/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
]

STATICFILES_DIRS = [
"dist",
os.path.join(BASE_DIR, "frontend", "dist"),
]

# Djang Compressor settings
Expand Down

0 comments on commit ebc3953

Please sign in to comment.