Skip to content

Commit

Permalink
Refactor docker for tests and other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-aranda committed Feb 22, 2022
1 parent 6e417bd commit 8e68a2d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ pipeline {
}
steps {
script {
sh "docker run ${dockerImageName} pytest"
sh "docker build -f docker/Dockerfile-test -t love-manager-test ."
sh "docker run love-manager-test"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This docker-compose does not copy the code into the image, but instead it mounts
Follow these instructions to run the application in a docker container and get into it:

```
cd docker/
docker-compose up -d --build
docker-compose exec manager bash
```
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ VOLUME /usr/src/love/manager/static
VOLUME /usr/src/love/manager/media
EXPOSE 8000

# Set env variables for runtime (to be replaced in docker-cpomse files)
# Set env variables for runtime (to be replaced in docker-compose files)
ENV ADMIN_USER_PASS=test
ENV USER_USER_PASS=test
ENV CMD_USER_PASS=test
Expand Down
22 changes: 22 additions & 0 deletions docker/Dockerfile-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.8.2-buster

# Install required packages
RUN apt-get update && \
apt-get install -y \
libsasl2-dev \
python-dev \
libldap2-dev \
libssl-dev &&\
rm -rf /var/lib/apt/lists/*

# Set workdir and install python requirements
WORKDIR /usr/src/love
COPY manager/requirements.txt .
RUN pip install -r requirements.txt

# Copy source code and build project
COPY manager ./manager
WORKDIR /usr/src/love/manager

# Run daphne server in runtime
CMD ["pytest"]
3 changes: 0 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ services:
restart: always
volumes:
- ../:/usr/src/love
command: "sleep infinity"
stdin_open: true
tty: true

0 comments on commit 8e68a2d

Please sign in to comment.