Skip to content

Commit

Permalink
docker vite build
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpbennett committed Jan 8, 2024
1 parent bbb8ffb commit a6d48ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.10-slim

# Install Node.js
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs

EXPOSE 8000

# Keeps Python from generating .pyc files in the container
Expand All @@ -20,9 +25,16 @@ RUN pip install pipenv && pipenv install --dev --system --deploy
# Install async-timeout and numpy
RUN pip install async-timeout numpy exceptiongroup

# Copy and build the Vite project
COPY static/package*.json /app/static/
WORKDIR /app/static
RUN npm install
RUN npm run build

# Copy the rest of the application files into the container
COPY src /app/src
COPY static /app/static/
COPY --from=vite-build /app/static/dist /app/static/dist

# Creates a non-root user with an explicit UID and adds permission to access the /app folder
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
Expand Down
12 changes: 0 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ services:
restart: always
ports:
- '6379:6379'
networks:
- etlnetwork

postgres:
image: postgres:latest
Expand All @@ -23,17 +21,13 @@ services:
POSTGRES_DB: 'postgres'
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- etlnetwork

pipeline:
image: etl-pipeline
build:
context: .
dockerfile: ./Dockerfile
command: ['python', 'src/main.py']
networks:
- etlnetwork

api:
image: etl-api
Expand All @@ -43,9 +37,3 @@ services:
command: ['uvicorn', 'src.api:app', '--host', '0.0.0.0', '--port', '80']
ports:
- '80:80'
networks:
- etlnetwork

networks:
etlnetwork:
driver: bridge

0 comments on commit a6d48ea

Please sign in to comment.