Skip to content

Commit

Permalink
fix(tests): EOFError in integration tests for FTP and SFTP resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ohappykust committed Nov 19, 2024
1 parent 486041a commit 6fc3e74
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
postgres:
build:
context: ..
dockerfile: docker/Dockerfile
dockerfile: docker/postgres.Dockerfile
environment:
POSTGRES_PASSWORD: shillelagh123
POSTGRES_USER: shillelagh
Expand All @@ -16,22 +16,22 @@ services:
- "5432:5432"

ftp:
image: stilliard/pure-ftpd:hardened
build:
context: ..
dockerfile: docker/ftp.Dockerfile
environment:
PUBLICHOST: "localhost"
FTP_USER_NAME: shillelagh
FTP_USER_PASS: shillelagh123
FTP_USER_HOME: /home/shillelagh
volumes:
- ./data:/home/shillelagh
ports:
- "2121:21"
- "30000-30009:30000-30009"

sftp:
image: atmoz/sftp
volumes:
- ./data:/home/shillelagh
build:
context: ..
dockerfile: docker/sftp.Dockerfile
environment:
SFTP_USERS: "shillelagh:shillelagh123:1001"
ports:
Expand Down
3 changes: 3 additions & 0 deletions docker/ftp.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM stilliard/pure-ftpd:hardened

COPY ./docker/data /home/shillelagh
39 changes: 39 additions & 0 deletions docker/postgres.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use the official Postgres image as a base
FROM postgres:13

WORKDIR /code
COPY . /code

# Use root for package installation
USER root

# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
postgresql-server-dev-13 \
python3 \
python3-dev \
python3-pip \
python3-venv \
wget

# Download, build, and install multicorn2
RUN wget https://github.com/pgsql-io/multicorn2/archive/refs/tags/v2.5.tar.gz && \
tar -xvf v2.5.tar.gz && \
cd multicorn2-2.5 && \
make && \
make install


# Create a virtual environment and install dependencies
RUN python3 -m venv /code/venv && \
/code/venv/bin/pip install --upgrade pip && \
/code/venv/bin/pip install -e '.[all]' && \
/code/venv/bin/pip install 'multicorn @ git+https://github.com/pgsql-io/[email protected]'

# Set environment variable for PostgreSQL to use the virtual environment
ENV PATH="/code/venv/bin:$PATH"

# Switch back to the default postgres user
USER postgres
3 changes: 3 additions & 0 deletions docker/sftp.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM atmoz/sftp

COPY ./docker/data /home/shillelagh

0 comments on commit 6fc3e74

Please sign in to comment.