Skip to main content

Files

Files in Thevenin allow you to upload and manage configuration files, scripts, and other static content that your applications need to run. These files can be mounted into your containers at specific paths, making them accessible to your applications at runtime.

Overview

The Files feature enables you to:

  • Upload configuration files, scripts, or any static content
  • Mount files into containers at specific paths
  • Manage files across different environments

Creating a File

To create a new file:

  1. Navigate to your environment

  2. Go to the Attachments section

  3. Click on Files

  4. Click Create File

  5. Fill in the required information:

    • Name: A descriptive name for the file
    • Description: Optional description of the file's purpose
    • File Path: The path where the file will be mounted in the container (e.g., /app/config/settings.json)
    • Content: The actual content of the file
  6. Click Create to save the file

Mounting Files in Applications

Once you've created a file, you can mount it in your applications:

  1. Go to your application's configuration
  2. In the Files section, select the files you want to mount
  3. The files will be available at their specified paths when the container starts

File Path Guidelines

When specifying file paths:

  • Use absolute paths (e.g., /app/config/app.conf)
  • Ensure the path doesn't conflict with existing container files
  • Consider using standard configuration directories like /etc/, /config/, or /app/config/

Use Cases

Configuration Files

Mount application configuration files like config.json, settings.yml, or .env files.

{
"database": {
"host": "db.example.com",
"port": 5432
}
}

Scripts

Upload initialization scripts or utility scripts that your application needs.

#!/bin/bash
echo "Running initialization script..."
# Your script content

SSL Certificates

Store and mount SSL certificates for secure connections.

Application Secrets

Mount sensitive configuration files (though consider using Variable Sets for simple key-value secrets).

Best Practices

  1. Use Descriptive Names: Name your files clearly to indicate their purpose
  2. Environment-Specific Files: Create separate files for different environments
  3. File Size: Keep files reasonably sized for quick loading and deployment
  4. Security: Be cautious with sensitive data - ensure files containing secrets are properly secured

Managing Files

Updating a File

To update an existing file:

  1. Navigate to the file in your environment's Attachments section
  2. Click on the file to open it
  3. Click Edit
  4. Update the content or configuration
  5. Click Save

Deleting a File

To delete a file:

  1. Navigate to the file in your environment's Attachments section
  2. Click on the file
  3. Click Delete
  4. Confirm the deletion
warning

Deleting a file that's currently mounted in a running application may cause errors. Ensure you remove file mounts from applications before deleting files.

Common Patterns

Application Configuration

# app-config.yml
server:
port: 8080
host: 0.0.0.0
database:
connection_string: ${DB_CONNECTION_STRING}

Nginx Configuration

# nginx.conf
server {
listen 80;
server_name example.com;

location / {
proxy_pass http://backend:8080;
proxy_set_header Host $host;
}
}

Initialization Scripts

#!/bin/bash
# init.sh
echo "Starting application initialization..."
npm run migrate
npm run seed
echo "Initialization complete!"

Limitations

  • Maximum file size: 10MB per file
  • Files are read-only inside containers
  • File paths must be absolute
  • Special characters in file paths should be avoided

Next Steps