Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docker setup & config #1843

Merged
merged 16 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Pwuts marked this conversation as resolved.
Show resolved Hide resolved
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
nponeccop marked this conversation as resolved.
Show resolved Hide resolved
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:
Pwuts marked this conversation as resolved.
Show resolved Hide resolved
MEMORY_BACKEND: redis
REDIS_HOST: redis
volumes:
- "./autogpt:/app"
- ".env:/app/.env"
- ./logs:/app/logs
Pwuts marked this conversation as resolved.
Show resolved Hide resolved
- ./auto_gpt_workspace/:/app/auto_gpt_workspace
- ./ai_settings.yaml:/app/ai_settings.yaml
profiles: ["exclude-from-up"]

redis:
Expand Down