https://github.com/clarin-eric/virtual_alpine-nginx
Virtualized static content web server.
https://github.com/clarin-eric/virtual_alpine-nginx
Last synced: 5 months ago
JSON representation
Virtualized static content web server.
- Host: GitHub
- URL: https://github.com/clarin-eric/virtual_alpine-nginx
- Owner: clarin-eric
- Created: 2015-11-27T17:23:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T16:40:54.000Z (over 10 years ago)
- Last Synced: 2025-09-10T03:14:44.624Z (9 months ago)
- Language: Shell
- Size: 10.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
== Requirements
* https://packer.io[Packer].
* https://www.docker.com/[Docker] >= 1.9.0.
== To build
* Make sure that you have the relevant Docker volumes ready. These will be provisioned during build. If not, create them:
+
[source,Sh]
----
docker volume create --name 'etc-CLARIN_TLS--infra' &&
docker volume create --name 'srv-www-infra.clarin.eu--infra'
----
+
* Follow this https://github.com/sanmai-NL/guide_on_submodules[brief guide on submodules] to learn how to manage dependency submodules, if you do not know it already. Complete https://github.com/sanmai-NL/recursive_packer_build/blob/master/Project_dependencies_as_Git_submodules.adoc#getting-started-with-a-git-repository-that-has-submodules[the recursive clone] or submodule initialization of this repository.
* Complete a https://github.com/sanmai-NL/recursive_packer_build#to-use[recursive Packer build] by issuing `build_all` from a POSIX shell with the root of your clone of this repository as working directory.
== To configure
* After the previously described build process has completed successfully, `cd` to the root directory of your local copy of this repository.
* Determine which version of the image you want to use. To set the shell variable BUILD_REVISION to the tag specified to the previous build:
+
[source,Sh]
----
BUILD_REVISION="$(git rev-parse --short @)"
----
+
* Create the application container:
+
[source,Sh]
----
docker create \
--name="alpine-nginx--infra--${BUILD_REVISION}" \
--publish='127.0.0.1:443:443' \
--publish='127.0.0.1:80:80' \
--entrypoint='/usr/sbin/nginx' \
--hostname='infra.clarin.eu' \
--volume='etc-CLARIN_TLS--infra:/etc/CLARIN_TLS/' \
--volume='srv-www-infra.clarin.eu--infra:/srv/www/infra.clarin.eu/' \
"docker.clarin.eu/alpine-nginx:${BUILD_REVISION}"
----
== To run
[source,Sh]
----
docker start "alpine-nginx--infra--${BUILD_REVISION}" &&
docker exec -ti "alpine-nginx--infra--${BUILD_REVISION}" /bin/sh
----
=== To destroy
[source,Sh]
----
docker stop "alpine-nginx--infra--${BUILD_REVISION}" &&
docker rm "alpine-nginx--infra--${BUILD_REVISION}" &&
## WARNING: The following will delete all data in these volumes!
docker volume rm 'etc-CLARIN_TLS--infra' 'srv-www-infra.clarin.eu--infra'
----