Skip to content

Home Directory appears after "Clone Repository in Container Volume..." #647

Open
@schn4v1d

Description

@schn4v1d

image

Everything seems to be working but after cloning this folder appears in /workspaces/utas-dev and I don't know what causes this.

This is my devcontainer.json:

{
    "name": "Utas PHP",
    "dockerComposeFile": "docker-compose.yml",
    "service": "app",
    "workspaceFolder": "/workspaces/utas-dev",
    "customizations": {
        "vscode": {
            "settings": {
                "php.suggest.basic": false
            },
            "extensions": [
                "zobo.php-intellisense"
            ]
        }
    },
    "portsAttributes": {
        "8000": {
            "label": "Application",
            "onAutoForward": "notify"
        },
        "8081": {
            "label": "Database",
            "onAutoForward": "notify"
        }
    },
    "postCreateCommand": "composer update"
}

with this docker-compose.yml:

version: "3"

services:
  app:
    build: .
    ports:
      - "8000:80"
    depends_on:
      - "mysql.80"

  mysql.80:
    image: "mysql/mysql-server:8.0"
    restart: unless-stopped
    volumes:
      - db-data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 'secret'
      MYSQL_DATABASE: v261
      MYSQL_USER: utas
      MYSQL_PASSWORD: utas
    ports:
      - "8081:3306"

volumes:
  db-data:

and this Dockerfile all in the .devcontainers folder:

FROM php:8.1-apache

RUN apt-get update && apt-get install -y \
    vim \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    git \
    libzip-dev \
    unzip \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) bcmath gd zip mysqli exif pdo pdo_mysql

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

ENV APACHE_DOCUMENT_ROOT /workspaces/utas-dev

RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN a2enmod rewrite

RUN useradd -ms /bin/bash utas

RUN mkdir -p $APACHE_DOCUMENT_ROOT
RUN chown -R utas:utas $APACHE_DOCUMENT_ROOT

Please help me in solving this as I am quite new to the whole dev containers world :)

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions