-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Related to: - #1054 ## Description of Changes Creating a test-specific 🐳 Docker file. This will be the first step in implementing PostgreSQL in the testing environment so that we can get a true 1:1 comparison between the environments. ## Tests and linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
- Loading branch information
1 parent
ec9a1ec
commit 2d82e06
Showing
5 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,16 +25,13 @@ services: | |
restart: always | ||
build: | ||
context: . | ||
args: | ||
- DOCKER_BUILD_ENV | ||
- MAKE_PYTHON_VERSION | ||
dockerfile: ./dockerfiles/web/Dockerfile | ||
dockerfile: dockerfiles/web/Dockerfile-dev | ||
environment: | ||
APPROVE_REGISTRATIONS: "${APPROVE_REGISTRATIONS}" | ||
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}" | ||
AWS_DEFAULT_REGION: "${AWS_DEFAULT_REGION}" | ||
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}" | ||
ENV: "${ENV:-development}" | ||
ENV: "development" | ||
FLASK_APP: OpenOversight.app | ||
FLASK_DEBUG: 1 | ||
OO_HELP_EMAIL: "[email protected]" | ||
|
@@ -55,3 +52,19 @@ services: | |
- "3000" | ||
ports: | ||
- "3000:3000" | ||
|
||
web-test: | ||
restart: always | ||
build: | ||
context: . | ||
args: | ||
- MAKE_PYTHON_VERSION | ||
dockerfile: dockerfiles/web/Dockerfile-test | ||
environment: | ||
ENV: "testing" | ||
FLASK_APP: OpenOversight.app | ||
OO_HELP_EMAIL: "[email protected]" | ||
OO_SERVICE_EMAIL: "[email protected]" | ||
TIMEZONE: "America/Chicago" | ||
volumes: | ||
- ./OpenOversight/:/usr/src/app/OpenOversight/:z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM python:3.11-bullseye | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ENV CURL_FLAGS="--proto =https --tlsv1.2 -sSf -L --max-redirs 1 -O" | ||
|
||
ENV DEBIAN-FRONTEND noninteractive | ||
ENV DISPLAY=:1 | ||
|
||
# install apt dependencies | ||
RUN apt-get update && apt-get install -y xvfb libpq-dev python3-dev && \ | ||
apt-get clean | ||
|
||
# install node | ||
ENV NODE_SETUP_SHA=5d07994f59e3edc2904c547e772b818d10abb066f6ff36ab3db5d686b0fe9a73 | ||
RUN curl ${CURL_FLAGS} \ | ||
https://raw.githubusercontent.com/nodesource/distributions/b8510857fb4ce4b023161be8490b00119884974c/deb/setup_12.x | ||
RUN echo "${NODE_SETUP_SHA} setup_12.x" | sha256sum --check - | ||
RUN bash setup_12.x | ||
RUN apt-get install -y nodejs | ||
|
||
# install yarn | ||
RUN npm install -g yarn | ||
RUN mkdir /var/www ./node_modules /.cache /.yarn /.mozilla | ||
RUN touch /usr/src/app/yarn-error.log | ||
COPY yarn.lock /usr/src/app/ | ||
RUN chmod -R 777 /usr/src/app/ /var/lib/xkb /.cache /.yarn /.mozilla | ||
|
||
|
||
COPY requirements.txt /usr/src/app/ | ||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
||
COPY package.json /usr/src/app/ | ||
RUN yarn | ||
|
||
COPY test_data.py /usr/src/app/ | ||
|
||
ENV SECRET_KEY 4Q6ZaQQdiqtmvZaxP1If | ||
ENV SQLALCHEMY_DATABASE_URI postgresql://openoversight:terriblepassword@postgres/openoversight-dev | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
CMD ["OpenOversight/scripts/entrypoint_dev.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters