Skip to content

Commit

Permalink
Improve docker setup & config
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Apr 16, 2023
1 parent 5e67722 commit 2ade317
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# Use an official Python base image from the Docker Hub
FROM python:3.11-slim

# Install git
RUN apt-get -y update
RUN apt-get -y install git
# Install packages
RUN apt-get update && apt-get install -y curl jq git

# Set environment variables
ENV PIP_NO_CACHE_DIR=yes \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1

# Create a non-root user and set permissions
RUN useradd --create-home appuser
WORKDIR /home/appuser
RUN chown appuser:appuser /home/appuser
USER appuser
# Install the required python packages globally
ENV PATH="$PATH:/root/.local/bin"
COPY requirements-docker.txt .
RUN pip install --no-cache-dir -r requirements-docker.txt

# Copy the requirements.txt file and install the requirements
COPY --chown=appuser:appuser requirements-docker.txt .
RUN pip install --no-cache-dir --user -r requirements-docker.txt
# Create a non-root user
RUN useradd -u 1000 appuser
USER appuser

# Copy the application files
WORKDIR /app
COPY --chown=appuser:appuser autogpt/ ./autogpt

# Set the entrypoint
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ services:
build: ./
env_file:
- .env
environment:
MEMORY_BACKEND: redis
REDIS_HOST: redis
volumes:
- "./autogpt:/app"
- ".env:/app/.env"
- ./logs:/app/logs
- ./auto_gpt_workspace/:/app/auto_gpt_workspace
- ./ai_settings.yaml:/app/ai_settings.yaml
profiles: ["exclude-from-up"]

redis:
Expand Down

0 comments on commit 2ade317

Please sign in to comment.