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

Dockerised piccolo_admin #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use an official Node.js runtime as a parent image
FROM node:20

# Set the working directory to /admin_ui
WORKDIR /admin_ui

# Copy the current directory contents into the container at /admin_ui
COPY admin_ui .

# Install any needed packages specified in package.json
RUN npm install --no-audit --no-fund

# Expose port 3000
EXPOSE 3000

# Run npm run dev when the container launches
CMD ["npm", "run", "dev"]
Comment on lines +4 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution is OK for development, but for production we don't need to install the npm dependencies etc. When we release piccolo_admin on PyPI, we bundle all of the front end assets.

So we just need a Python file which runs create_admin, but reads the database values from environment variables.

2 changes: 1 addition & 1 deletion admin_ui/vite.config.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
emptyOutDir: true
},
server: {
host: "127.0.0.1",
host: "0.0.0.0",
port: 3000,
proxy: {
"^/api": {
Expand Down