aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-11-11 23:57:44 -0600
committerParker <contact@pkrm.dev>2024-11-11 23:57:44 -0600
commit52127adb08cff9e6bf6bad0125c3b5f7e0d04db2 (patch)
tree9b2b8a793aed986a54603b8530af2a0f8ae4ca30 /Dockerfile
parent386e6dcb35c866d204e2d32fd814aa7ca3ed15ae (diff)
Merge API+APP in Docker
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile21
1 files changed, 17 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index 418ba9d..be8870e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,25 @@
-FROM python:3.11-slim
+FROM node:18-slim AS build-ui
+
+WORKDIR /app
+COPY app/ ./
+RUN yarn install
+RUN yarn build
+
+FROM python:3.11-slim AS api
LABEL org.opencontainers.image.source="https://github.com/PacketParker/LinkLogger"
LABEL maintainer="parker <mailto:contact@pkrm.dev>"
WORKDIR /
-
COPY . .
RUN pip install -r requirements.txt
-ENTRYPOINT [ "python" ]
-CMD [ "-u", "linklogger.py" ] \ No newline at end of file
+RUN apt-get update && apt-get install -y nginx && \
+ rm -rf /var/lib/apt/lists/*
+
+# Move the built files into the nginx share
+COPY --from=build-ui /app/dist /usr/share/nginx/html
+# Replace the default site with the LinkLogger config
+COPY nginx.conf /etc/nginx/sites-enabled/default
+
+CMD service nginx start && python -u linklogger.py \ No newline at end of file