title: Setup Oracle database with docker-compose
body: <p>I want to start a Docker-container with Oracle XE and then run an SQL script (setup_database.sql) to create some tables in docker-compose.</p>
  
  <p>How can I integrate the following commands into my docker-compose:</p>
  
  <pre><code>docker run -d -p 49161:1521 -v "$PWD":/duo --name duodb --hostname duodb --network duo-test -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g-r2
  </code></pre>
  
  <p>Run a terminal in container:</p>
  
  <pre><code>docker exec -ti duodb /bin/bash
  </code></pre>
  
  <p>go into the right directory:</p>
  
  <pre><code>cd duo/sql
  </code></pre>
  
  <p>Kick off the setup_database script:</p>
  
  <pre><code>sqlplus system/oracle@xe @setup_database
  </code></pre>
  
  <p>I've tried to do run this:</p>
  
  <pre><code>oracle:
      container_name: duodb
      image: wnameless/oracle-xe-11g-r2 
      ports:
          - '49161:1521'
      volumes:
          - .:/duo
      command: ["/bin/bash", "-c", "sqlplus system/oracle@xe @setup_database"]
      environment:
          - ORACLE_ALLOW_REMOTE=true 
  </code></pre>
  
  <p>But this outputs the following error:</p>
  
  <pre><code>Creating network "duo_default" with the default driver
  Creating duodb
  Creating duomail
  Creating duolocal
  Attaching to duomail, duodb, duolocal
  duomail      | MailDev webapp running at http://0.0.0.0:80
  duomail      | MailDev SMTP Server running at 0.0.0.0:25
  duodb        | /bin/bash: sqlplus: command not found
  duodb exited with code 127
  duolocal     | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
  duolocal     | [Fri Nov 15 08:17:55.944907 2019] [ssl:warn] [pid 1] AH01909: 172.20.0.3:443:0 server certificate does NOT include an ID which matches the server name
  duolocal     | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
  duolocal     | [Fri Nov 15 08:17:55.977329 2019] [ssl:warn] [pid 1] AH01909: 172.20.0.3:443:0 server certificate does NOT include an ID which matches the server name
  duolocal     | [Fri Nov 15 08:17:55.980390 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.1.32 OpenSSL/1.1.1d configured -- resuming normal operations
  duolocal     | [Fri Nov 15 08:17:55.980423 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
  </code></pre>