-
Notifications
You must be signed in to change notification settings - Fork 859
/
Dockerfile
48 lines (32 loc) · 1.17 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
43
44
45
46
47
48
FROM node:20 AS builder
WORKDIR /frontend
COPY ./frontend/package.json ./frontend/yarn.lock ./
RUN yarn --network-timeout 600000 --frozen-lockfile
COPY ./frontend ./
RUN rm -rf .env
RUN yarn build
# Backend Dockerfile
FROM python:3.11
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
# Install system dependencies
RUN apt-get update && rm -rf /var/lib/apt/lists/*
RUN wget -O golang-migrate.deb https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.${TARGETOS}-${TARGETARCH}${TARGETVARIANT}.deb \
&& dpkg -i golang-migrate.deb \
&& rm golang-migrate.deb
# Install Poetry
RUN pip install poetry
# Set the working directory
WORKDIR /backend
# Copy only dependencies
COPY ./backend/pyproject.toml ./backend/poetry.lock* ./
# Install dependencies
# --only main: Skip installing packages listed in the [tool.poetry.dev-dependencies] section
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --only main
# Copy the rest of backend
COPY ./backend .
# Copy the frontend build
COPY --from=builder /frontend/dist ./ui
ENTRYPOINT [ "uvicorn", "app.server:app", "--host", "0.0.0.0", "--log-config", "log_config.json" ]