Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created frontend folder for npm + tailwind config #5

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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