-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (34 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Stage 01 - Build Vue Application
FROM node:20 as vue-builder
WORKDIR /app
# Copying package.json and package-lock.json
COPY service/frontend/wand-zero/package*.json ./
# Installing Node.js dependencies
RUN npm install
# Copying the rest of the frontend application
COPY service/frontend/wand-zero/ .
# Building the Vue application
RUN npm run build
# Stage 02 - Build FastAPI Application
FROM python:3.12 as fastapi-builder
WORKDIR /app
# Installing Poetry
RUN curl -sSL https://install.python-poetry.org | python3 - && \
ln -s $HOME/.local/bin/poetry /usr/local/bin/poetry
# Copying the Python project files
COPY pyproject.toml poetry.lock* ./
# Installing Python dependencies with Poetry without creating a virtual environment
RUN poetry config virtualenvs.create false && \
poetry install --no-dev --no-interaction --no-ansi
# Copying the FastAPI application code
COPY service/backend .
# Copying the Vue build artifacts from the vue-builder stage
COPY --from=vue-builder /app/dist /app/app/web
# Preparing the start script and creating a non-root user
COPY start.sh /start.sh
RUN chmod +x /start.sh && \
adduser --system --no-create-home wand
LABEL org.opencontainers.image.source=https://github.com/mattholy/wand
USER wand
EXPOSE 80
CMD ["/start.sh"]