Skip to content

Instantly share code, notes, and snippets.

@afgane
Last active June 6, 2019 21:38
Show Gist options
  • Select an option

  • Save afgane/950ff8a3e6dd840554c1c8b65f28fca5 to your computer and use it in GitHub Desktop.

Select an option

Save afgane/950ff8a3e6dd840554c1c8b65f28fca5 to your computer and use it in GitHub Desktop.
A version of the Dockerfile for building the minimal Galaxy image using a single stage build.
FROM ubuntu:18.04
# Init ARGs
ARG ROOT_DIR=/galaxy
ARG SERVER_DIR=$ROOT_DIR/server
# NOTE: the value of GALAXY_USER must be also hardcoded in COPY in final stage
ARG GALAXY_USER=galaxy
ARG DEBIAN_FRONTEND=noninteractive
# Install build dependencies + ansible
RUN set -xe; \
apt-get -qq update && apt-get install -y \
apt-transport-https \
git \
make \
python-virtualenv \
software-properties-common \
libpython2.7 \
gcc \
&& apt-add-repository -y ppa:ansible/ansible \
&& apt-get -qq update && apt-get install -y --no-install-recommends \
ansible \
# && apt-get autoremove -y && apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/*
WORKDIR /tmp/ansible
RUN rm -rf *
COPY . .
RUN ansible-playbook -i localhost, playbook.yml -vv
# Remove build artifacts + files not needed in container
WORKDIR $SERVER_DIR
RUN rm -rf \
.ci \
.git \
.venv/bin/node \
.venv/include/node \
.venv/lib/node_modules \
.venv/src/node* \
client/node_modules \
doc \
test \
test-data
# Create Galaxy user, group, directory; chown
RUN set -xe; \
adduser --system --group $GALAXY_USER \
&& mkdir -p $SERVER_DIR \
&& chown $GALAXY_USER:$GALAXY_USER $ROOT_DIR -R
WORKDIR $SERVER_DIR
EXPOSE 8080
USER $GALAXY_USER
ENV PATH="$SERVER_DIR/.venv/bin:${PATH}"
# [optional] to run:
#CMD uwsgi --yaml config/galaxy.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment