Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
FROM gitpod/workspace-full
FROM gitpod/workspace-full:latest

USER root
# optional: use a custom apache config.
COPY apache.conf /etc/apache2/apache2.conf

# install via Ubuntu's APT:
# * Apache - the web server
# * Multitail - see logs live in the terminal
RUN apt-get update \
&& apt-get -y install apache2 multitail \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*

# 1. give write permission to the gitpod-user to apache directories
# 2. let Apache use apache.conf and apache.env.sh from our /workspace/<myproject> folder
RUN chown -R gitpod:gitpod /var/run/apache2 /var/lock/apache2 /var/log/apache2 \
&& echo "include \${GITPOD_REPO_ROOT}/apache.conf" > /etc/apache2/apache2.conf \
&& echo ". \${GITPOD_REPO_ROOT}/apache.env.sh" > /etc/apache2/envvars
# optional: change document root folder. It's relative to your git working copy.
ENV APACHE_DOCROOT_IN_REPO="www"
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
image:
file: .gitpod.dockerfile
context: apache
ports:
- port: 8080
onOpen: open-preview
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ open [https://gitpod.io#https://github.com/gitpod-io/apache-example](https://git

## What this Example does

* use the Dockerfile to install Apache via apt-get, because in the Dockerfile we have root access
* configure Apache via apache.conf and apache.env.sh from the Gitpod workspace
* have a minimal Apache config in apache.conf
* run Apache as gitpod:gitpod
* use the Dockerfile to configure Apache
* optional: use a custom and minimal apache.conf. If you don't do this, the default from workspace-full will be used.
* follow the Apache logs in the Gitpod Terminal View via multitail
* run apache on port 8080, because as unpreviliged process it can't open port 80
* run apache on port 8080

## Terminal Commands to try
* `apachectl start` - start Apache Web Server (it's started automatically on workspace launch)
Expand Down
7 changes: 0 additions & 7 deletions apache.env.sh

This file was deleted.

File renamed without changes.