Last active
August 29, 2015 14:26
-
-
Save haf/9ed5aafbc8efd937c230 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
set -x | |
echo '## build deps' && \ | |
yum install -y mono-complete fsharp && \ | |
yum upgrade ca-certificates --disablerepo=epel && \ | |
yum update -y && \ | |
yum clean all | |
echo '## build' && \ | |
cd $BUILD_PREFIX && \ | |
mono paket.bootstrapper.exe && \ | |
mono paket.exe restore && \ | |
xbuild /verbosity:minimal /p:Configuration=Release MyApp.sln | |
echo '## prepare /app' && \ | |
mkdir -p $APP_PREFIX/{bin,public} && \ | |
cp -r MyApp/bin/Release/* $APP_PREFIX/bin/ && \ | |
groupadd -r app && \ | |
useradd -d $APP_PREFIX -r -g app app && \ | |
chown -R app:app $APP_PREFIX | |
echo '## cleanup' && \ | |
mv /var/cache/yum/ /tmp/ && \ | |
mv /var/lib/rpm/__db* /tmp/ && \ | |
yum clean all && \ | |
/bin/rm -rf /tmp/build && \ | |
(/bin/rm -rf /tmp/* || true) | |
echo '## done' |
This file contains hidden or 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
FROM centos:latest | |
MAINTAINER Henrik Feldt <[email protected]> | |
ENV BUILD_PREFIX /tmp/build | |
ENV APP_PREFIX /app | |
ENV LISTEN_PORT=8083 | |
RUN mkdir -p $BUILD_PREFIX | |
COPY paket.dependencies $BUILD_PREFIX/paket.dependencies | |
COPY paket.lock $BUILD_PREFIX/paket.lock | |
COPY tools/paket.bootstrapper.exe $BUILD_PREFIX/paket.bootstrapper.exe | |
COPY tools/dockerbuild.sh $BUILD_PREFIX/dockerbuild.sh | |
COPY . $BUILD_PREFIX | |
WORKDIR $BUILD_PREFIX | |
# common packages across builds: | |
RUN yum install -y epel-release yum-utils && \ | |
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" && \ | |
yum-config-manager --add-repo http://download.mono-project.com/repo/centos/ && \ | |
yum install -y libmono-2_0-1 libmonoboehm-2_0-1 libmonosgen-2_0-1 mono-core mono-data mono-data-sqlite mono-locale-extras mono-web mono-winfxcore | |
RUN ./dockerbuild.sh | |
ENV LISTEN_PORT=8081 | |
EXPOSE $LISTEN_PORT | |
COPY tools/start $APP_PREFIX/start | |
WORKDIR $APP_PREFIX/public | |
USER app | |
ENTRYPOINT $APP_PREFIX/start |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
/usr/bin/env mono $APP_PREFIX/bin/MyApp.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment