Skip to content

Commit

Permalink
Merge pull request #70 from degica/devcontainer-support
Browse files Browse the repository at this point in the history
Devcontainer support
  • Loading branch information
Resonious authored Jul 25, 2022
2 parents 7077675 + 802eced commit dff1b86
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "komoju-woocommerce",
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "web",
"workspaceFolder": "/var/www/html/wp-content/plugins/komoju-woocommerce",
"remoteUser": "me",
"extensions": [],
"shutdownAction": "stopCompose",
"hostRequirements": {
"cpus": 1,
"memory": "4gb"
},
"remoteEnv": {
"CYPRESS_BASE_URL": "http://localhost"
},
"forwardPorts": [80],
"portsAttributes": {
"80": {
"label": "WordPress",
"onAutoForward": "notify",
"requireLocalPort": false
}
},
"otherPortsAttributes": {
"onAutoForward": "silent"
}
}
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM wordpress:latest
ARG woocommerce_version

RUN apt-get update \
&& apt-get install -y --no-install-recommends unzip wget gettext vim \
&& apt-get install -y --no-install-recommends unzip wget gettext vim bash-completion ssh git xvfb chromium sudo \
&& wget https://downloads.wordpress.org/plugin/woocommerce.${woocommerce_version}.zip -O /tmp/woocommerce.zip \
&& wget https://downloads.wordpress.org/plugin/relative-url.0.1.7.zip -O /tmp/relative-url.zip \
&& cd /usr/src/wordpress/wp-content/plugins \
Expand All @@ -19,4 +19,14 @@ RUN mkdir -p /var/www/html/wp-content/uploads/wc-logs/ \
&& chmod -R 666 /var/www/html/wp-content/uploads \
&& chown -R www-data /var/www/html/wp-content/uploads/

# Node JS
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --uid 1000 --shell /bin/bash --user-group --create-home me
RUN echo 'me ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/me

COPY . /var/www/html/wp-content/plugins/komoju-woocommerce

RUN chown -R me /var/www/html/wp-content/plugins/komoju-woocommerce

0 comments on commit dff1b86

Please sign in to comment.