-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from datacite/no-travis
Fix Dockerfile and add pull-request action
- Loading branch information
Showing
6 changed files
with
418 additions
and
271 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: CI Test | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build the stack | ||
run: docker compose -f "docker-compose.yml" up -d | ||
- name: Run Tests | ||
run: docker compose -f "docker-compose.yml" run web ./bin/ci.sh | ||
- name: Stop containers | ||
if: always() | ||
run: docker compose -f "docker-compose.yml" down |
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
FROM phusion/passenger-customizable:2.0.0 | ||
LABEL maintiainer="[email protected]" | ||
|
||
FROM phusion/passenger-full:1.0.6 | ||
# Set correct environment variables. | ||
ENV HOME /home/app | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
|
||
# Use baseimage-docker's init process. | ||
CMD ["/sbin/my_init"] | ||
|
||
# Update installed APT packages | ||
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \ | ||
apt-get install -y ntp pandoc | ||
|
||
# Fetch PIP install script and run | ||
ADD "https://bootstrap.pypa.io/get-pip.py" /tmp/get-pip.py | ||
RUN python3 /tmp/get-pip.py | ||
|
||
# Fetch pipenv install script and run | ||
ADD "https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py" /tmp/get-pipenv.py | ||
RUN python3 /tmp/get-pipenv.py | ||
# Allow app user to read /etc/container_environment | ||
RUN usermod -a -G docker_env app | ||
|
||
# Cleanup | ||
RUN /pd_build/python.sh | ||
# Update installed APT packages | ||
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" | ||
RUN apt-get install -y ntp pandoc pipenv | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
|
||
# Enable Passenger and Nginx and remove the default site | ||
# Preserve env variables for nginx | ||
RUN rm -f /etc/service/nginx/down && \ | ||
|
@@ -31,36 +31,36 @@ COPY vendor/docker/env.conf /etc/nginx/main.d/env.conf | |
# Use Amazon NTP servers | ||
COPY vendor/docker/ntp.conf /etc/ntp.conf | ||
|
||
# Run additional scripts during container startup (i.e. not at build time) | ||
RUN mkdir -p /etc/my_init.d | ||
|
||
# enable SSH | ||
RUN rm -f /etc/service/sshd/down && \ | ||
/etc/my_init.d/00_regen_ssh_host_keys.sh | ||
|
||
# install custom ssh key during startup | ||
COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh | ||
|
||
# restart server on file changes in development | ||
COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh | ||
|
||
## Viringo setup | ||
|
||
# Copy webapp folder | ||
COPY . /home/app/webapp/ | ||
|
||
# Copy tests over to app folder | ||
COPY tests /home/app/tests | ||
|
||
# Configure permissions | ||
RUN chown -R app:app /home/app/webapp && \ | ||
chmod -R 755 /home/app/webapp | ||
|
||
# Set working directory | ||
WORKDIR /home/app/webapp | ||
|
||
# Update Pip and Pipenv | ||
RUN pip install -U pip pipenv | ||
|
||
# Install any needed packages specified in pipenv pipfile | ||
RUN pipenv install --system --deploy --ignore-pipfile | ||
|
||
# Run additional scripts during container startup (i.e. not at build time) | ||
RUN mkdir -p /etc/my_init.d | ||
|
||
# enable SSH | ||
RUN rm -f /etc/service/sshd/down && \ | ||
/etc/my_init.d/00_regen_ssh_host_keys.sh | ||
|
||
# install custom ssh key during startup | ||
COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh | ||
|
||
# restart server on file changes in development | ||
COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh | ||
|
||
# Expose web | ||
EXPOSE 80 | ||
EXPOSE 80 |
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
Oops, something went wrong.